Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertBoolToString(v bool) string
- func ConvertStringToBool(v string) bool
- type AuthenticationExtensionsClientOutputs
- type Context
- type KeyPrint
- func (*KeyPrint) Descriptor() ([]byte, []int)
- func (m *KeyPrint) GetAddress() string
- func (m *KeyPrint) GetBiometricKey() []byte
- func (m *KeyPrint) GetBiometricKeyType() string
- func (m *KeyPrint) GetDeviceLabel() string
- func (m *KeyPrint) GetWebauthnKey() *WebauthnCredential
- func (m *KeyPrint) Marshal() (dAtA []byte, err error)
- func (m *KeyPrint) MarshalTo(dAtA []byte) (int, error)
- func (m *KeyPrint) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*KeyPrint) ProtoMessage()
- func (m *KeyPrint) Reset()
- func (m *KeyPrint) Size() (n int)
- func (m *KeyPrint) String() string
- func (m *KeyPrint) Unmarshal(dAtA []byte) error
- func (m *KeyPrint) XXX_DiscardUnknown()
- func (m *KeyPrint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *KeyPrint) XXX_Merge(src proto.Message)
- func (m *KeyPrint) XXX_Size() int
- func (m *KeyPrint) XXX_Unmarshal(b []byte) error
- type NodeCallback
- type PeerInfo
- func (*PeerInfo) Descriptor() ([]byte, []int)
- func (m *PeerInfo) GetId() string
- func (m *PeerInfo) GetMultiaddr() string
- func (m *PeerInfo) GetName() string
- func (m *PeerInfo) GetPeerId() string
- func (m *PeerInfo) GetType() PeerType
- func (m *PeerInfo) Marshal() (dAtA []byte, err error)
- func (m *PeerInfo) MarshalTo(dAtA []byte) (int, error)
- func (m *PeerInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PeerInfo) ProtoMessage()
- func (m *PeerInfo) Reset()
- func (m *PeerInfo) Size() (n int)
- func (m *PeerInfo) String() string
- func (m *PeerInfo) Unmarshal(dAtA []byte) error
- func (m *PeerInfo) XXX_DiscardUnknown()
- func (m *PeerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PeerInfo) XXX_Merge(src proto.Message)
- func (m *PeerInfo) XXX_Size() int
- func (m *PeerInfo) XXX_Unmarshal(b []byte) error
- type PeerType
- type SNRPubKey
- type WebauthnAuthenticator
- func (*WebauthnAuthenticator) Descriptor() ([]byte, []int)
- func (m *WebauthnAuthenticator) GetAaguid() []byte
- func (m *WebauthnAuthenticator) GetCloneWarning() bool
- func (m *WebauthnAuthenticator) GetSignCount() uint32
- func (m *WebauthnAuthenticator) Marshal() (dAtA []byte, err error)
- func (m *WebauthnAuthenticator) MarshalTo(dAtA []byte) (int, error)
- func (m *WebauthnAuthenticator) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*WebauthnAuthenticator) ProtoMessage()
- func (m *WebauthnAuthenticator) Reset()
- func (m *WebauthnAuthenticator) Size() (n int)
- func (m *WebauthnAuthenticator) String() string
- func (m *WebauthnAuthenticator) Unmarshal(dAtA []byte) error
- func (a *WebauthnAuthenticator) UpdateCounter(authDataCount uint32)
- func (m *WebauthnAuthenticator) XXX_DiscardUnknown()
- func (m *WebauthnAuthenticator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *WebauthnAuthenticator) XXX_Merge(src proto.Message)
- func (m *WebauthnAuthenticator) XXX_Size() int
- func (m *WebauthnAuthenticator) XXX_Unmarshal(b []byte) error
- type WebauthnCredential
- func (*WebauthnCredential) Descriptor() ([]byte, []int)
- func (c *WebauthnCredential) Did() string
- func (c *WebauthnCredential) FromMetadata(m map[string]string) error
- func (m *WebauthnCredential) GetAttestationType() string
- func (m *WebauthnCredential) GetAuthenticator() *WebauthnAuthenticator
- func (m *WebauthnCredential) GetId() []byte
- func (m *WebauthnCredential) GetPublicKey() []byte
- func (m *WebauthnCredential) GetTransport() []string
- func (m *WebauthnCredential) Marshal() (dAtA []byte, err error)
- func (m *WebauthnCredential) MarshalTo(dAtA []byte) (int, error)
- func (m *WebauthnCredential) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*WebauthnCredential) ProtoMessage()
- func (c *WebauthnCredential) PublicKeyMultibase() string
- func (m *WebauthnCredential) Reset()
- func (m *WebauthnCredential) Size() (n int)
- func (m *WebauthnCredential) String() string
- func (c *WebauthnCredential) ToMetadata() map[string]string
- func (c *WebauthnCredential) ToStdCredential() *webauthn.Credential
- func (m *WebauthnCredential) Unmarshal(dAtA []byte) error
- func (c *WebauthnCredential) Validate(pc *webauthn.Credential) error
- func (m *WebauthnCredential) XXX_DiscardUnknown()
- func (m *WebauthnCredential) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *WebauthnCredential) XXX_Merge(src proto.Message)
- func (m *WebauthnCredential) XXX_Size() int
- func (m *WebauthnCredential) XXX_Unmarshal(b []byte) error
Constants ¶
const ( ExtensionAppID = "appid" ExtensionAppIDExclude = "appidExclude" )
Variables ¶
var ( ErrInvalidLengthData = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowData = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupData = fmt.Errorf("proto: unexpected end of group") )
var PeerType_name = map[int32]string{
0: "UNKNOWN",
1: "HIGHWAY",
2: "MOTOR",
3: "VALIDATOR",
4: "THIRD_PARTY",
}
var PeerType_value = map[string]int32{
"UNKNOWN": 0,
"HIGHWAY": 1,
"MOTOR": 2,
"VALIDATOR": 3,
"THIRD_PARTY": 4,
}
Functions ¶
func ConvertBoolToString ¶
func ConvertStringToBool ¶
Types ¶
type AuthenticationExtensionsClientOutputs ¶
type AuthenticationExtensionsClientOutputs map[string]interface{}
type Context ¶ added in v0.3.0
type Context struct {
Ctx context.Context
ClientContext client.Context
HomeDir string
RepoPath string
NodeRESTUri string
NodeGRPCUri string
NodeFaucetUri string
Rendevouz string
BsMultiaddrs []string
// contains filtered or unexported fields
}
`Context` is a struct that contains the information needed to run the `go-ipfs` node. @property {string} HomeDir - The home directory of the user running the application. @property {string} RepoPath - The path to the IPFS repo. @property {string} NodeRESTUri - The REST endpoint of the node. @property {string} NodeGRPCUri - The GRPC endpoint of the node. @property {string} NodeFaucetUri - The URI of the faucet service. @property {string} Rendevouz - The rendevouz point for the swarm. @property {[]string} BsMultiaddrs - The bootstrap multiaddrs. @property encPubKey - The public key of the encryption key pair. @property encPrivKey - The private key used to encrypt the data.
func NewContext ¶ added in v0.3.0
NewContext creates a new context object, initializes the encryption keys, and returns the context object
func (*Context) DecryptMessage ¶ added in v0.3.0
The recipient can decrypt the message using their private key and the sender's public key. When you decrypt, you must use the same nonce you used to encrypt the message. One way to achieve this is to store the nonce alongside the encrypted message. Above, we stored the nonce in the first 24 bytes of the encrypted text.
func (*Context) EncryptMessage ¶ added in v0.3.0
Write encrypts a message using the box algorithm This encrypts msg and appends the result to the nonce.
type KeyPrint ¶
type KeyPrint struct {
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
BiometricKey []byte `protobuf:"bytes,2,opt,name=biometric_key,json=biometricKey,proto3" json:"biometric_key,omitempty"`
BiometricKeyType string `protobuf:"bytes,3,opt,name=biometric_key_type,json=biometricKeyType,proto3" json:"biometric_key_type,omitempty"`
WebauthnKey *WebauthnCredential `protobuf:"bytes,4,opt,name=webauthn_key,json=webauthnKey,proto3" json:"webauthn_key,omitempty"`
DeviceLabel string `protobuf:"bytes,5,opt,name=device_label,json=deviceLabel,proto3" json:"device_label,omitempty"`
}
KeyPrint is a object used by Motor clients to store key print information in Biometric storage or Webauthn
func (*KeyPrint) Descriptor ¶
func (*KeyPrint) GetAddress ¶
func (*KeyPrint) GetBiometricKey ¶
func (*KeyPrint) GetBiometricKeyType ¶
func (*KeyPrint) GetDeviceLabel ¶
func (*KeyPrint) GetWebauthnKey ¶
func (m *KeyPrint) GetWebauthnKey() *WebauthnCredential
func (*KeyPrint) MarshalToSizedBuffer ¶
func (*KeyPrint) ProtoMessage ¶
func (*KeyPrint) ProtoMessage()
func (*KeyPrint) XXX_DiscardUnknown ¶
func (m *KeyPrint) XXX_DiscardUnknown()
func (*KeyPrint) XXX_Marshal ¶
func (*KeyPrint) XXX_Unmarshal ¶
type NodeCallback ¶
NodeCallback is an interface with three methods: OnDiscover, OnLinking, and OnTopicMessage. @property OnDiscover - This is called when a node is discovered. The data is the data that was sent by the node. @property OnLinking - This is called when a node is linking to the gateway. @property OnTopicMessage - This is the callback that will be called when a message is received on a topic.
func DefaultCallback ¶
func DefaultCallback() NodeCallback
It returns a pointer to a defaultCallback struct
type PeerInfo ¶
type PeerInfo struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
PeerId string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
Multiaddr string `protobuf:"bytes,4,opt,name=multiaddr,proto3" json:"multiaddr,omitempty"`
Type PeerType `protobuf:"varint,5,opt,name=type,proto3,enum=sonrhq.common.v1.PeerType" json:"type,omitempty"`
}
Basic Info Sent to Peers to Establish Connections
func (*PeerInfo) Descriptor ¶
func (*PeerInfo) GetMultiaddr ¶
func (*PeerInfo) MarshalToSizedBuffer ¶
func (*PeerInfo) ProtoMessage ¶
func (*PeerInfo) ProtoMessage()
func (*PeerInfo) XXX_DiscardUnknown ¶
func (m *PeerInfo) XXX_DiscardUnknown()
func (*PeerInfo) XXX_Marshal ¶
func (*PeerInfo) XXX_Unmarshal ¶
type SNRPubKey ¶ added in v0.3.0
type SNRPubKey interface {
cryptotypes.PubKey
Bech32(pfix string) (string, error)
DID() string
Multibase() string
Raw() []byte
}
`SNRPubKey` is a `PubKey` that has a `DID` and a `Multibase` @property {string} DID - The DID of the SNR @property {string} Multibase - The multibase encoding of the DID.
type WebauthnAuthenticator ¶
type WebauthnAuthenticator struct {
// The AAGUID of the authenticator. An AAGUID is defined as an array containing the globally unique
// identifier of the authenticator model being sought.
Aaguid []byte `protobuf:"bytes,1,opt,name=aaguid,proto3" json:"aaguid,omitempty"`
// SignCount -Upon a new login operation, the Relying Party compares the stored signature counter value
// with the new signCount value returned in the assertion’s authenticator data. If this new
// signCount value is less than or equal to the stored value, a cloned authenticator may
// exist, or the authenticator may be malfunctioning.
SignCount uint32 `protobuf:"varint,2,opt,name=sign_count,json=signCount,proto3" json:"sign_count,omitempty"`
// CloneWarning - This is a signal that the authenticator may be cloned, i.e. at least two copies of the
// credential private key may exist and are being used in parallel. Relying Parties should incorporate
// this information into their risk scoring. Whether the Relying Party updates the stored signature
// counter value in this case, or not, or fails the authentication ceremony or not, is Relying Party-specific.
CloneWarning bool `protobuf:"varint,3,opt,name=clone_warning,json=cloneWarning,proto3" json:"clone_warning,omitempty"`
}
WebauthnAuthenticator contains certificate information about a WebAuthn authenticator
func (*WebauthnAuthenticator) Descriptor ¶
func (*WebauthnAuthenticator) Descriptor() ([]byte, []int)
func (*WebauthnAuthenticator) GetAaguid ¶
func (m *WebauthnAuthenticator) GetAaguid() []byte
func (*WebauthnAuthenticator) GetCloneWarning ¶
func (m *WebauthnAuthenticator) GetCloneWarning() bool
func (*WebauthnAuthenticator) GetSignCount ¶
func (m *WebauthnAuthenticator) GetSignCount() uint32
func (*WebauthnAuthenticator) Marshal ¶
func (m *WebauthnAuthenticator) Marshal() (dAtA []byte, err error)
func (*WebauthnAuthenticator) MarshalTo ¶
func (m *WebauthnAuthenticator) MarshalTo(dAtA []byte) (int, error)
func (*WebauthnAuthenticator) MarshalToSizedBuffer ¶
func (m *WebauthnAuthenticator) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*WebauthnAuthenticator) ProtoMessage ¶
func (*WebauthnAuthenticator) ProtoMessage()
func (*WebauthnAuthenticator) Reset ¶
func (m *WebauthnAuthenticator) Reset()
func (*WebauthnAuthenticator) Size ¶
func (m *WebauthnAuthenticator) Size() (n int)
func (*WebauthnAuthenticator) String ¶
func (m *WebauthnAuthenticator) String() string
func (*WebauthnAuthenticator) Unmarshal ¶
func (m *WebauthnAuthenticator) Unmarshal(dAtA []byte) error
func (*WebauthnAuthenticator) UpdateCounter ¶
func (a *WebauthnAuthenticator) UpdateCounter(authDataCount uint32)
VerifyCounter Step 17 of §7.2. about verifying attestation. If the signature counter value authData.signCount is nonzero or the value stored in conjunction with credential’s id attribute is nonzero, then run the following sub-step:
If the signature counter value authData.signCount is → Greater than the signature counter value stored in conjunction with credential’s id attribute. Update the stored signature counter value, associated with credential’s id attribute, to be the value of authData.signCount. → Less than or equal to the signature counter value stored in conjunction with credential’s id attribute. This is a signal that the authenticator may be cloned, see CloneWarning above for more information.
func (*WebauthnAuthenticator) XXX_DiscardUnknown ¶
func (m *WebauthnAuthenticator) XXX_DiscardUnknown()
func (*WebauthnAuthenticator) XXX_Marshal ¶
func (m *WebauthnAuthenticator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*WebauthnAuthenticator) XXX_Merge ¶
func (m *WebauthnAuthenticator) XXX_Merge(src proto.Message)
func (*WebauthnAuthenticator) XXX_Size ¶
func (m *WebauthnAuthenticator) XXX_Size() int
func (*WebauthnAuthenticator) XXX_Unmarshal ¶
func (m *WebauthnAuthenticator) XXX_Unmarshal(b []byte) error
type WebauthnCredential ¶
type WebauthnCredential struct {
// A probabilistically-unique byte sequence identifying a public key credential source and its authentication assertions.
Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// The public key portion of a Relying Party-specific credential key pair, generated by an authenticator and returned to
// a Relying Party at registration time (see also public key credential). The private key portion of the credential key
// pair is known as the credential private key. Note that in the case of self attestation, the credential key pair is also
// used as the attestation key pair, see self attestation for details.
PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
// The attestation format used (if any) by the authenticator when creating the credential.
AttestationType string `protobuf:"bytes,3,opt,name=attestation_type,json=attestationType,proto3" json:"attestation_type,omitempty"`
// The transports used by the authenticator when creating the credential.
Transport []string `protobuf:"bytes,4,rep,name=transport,proto3" json:"transport,omitempty"`
// The Authenticator information for a given certificate
Authenticator *WebauthnAuthenticator `protobuf:"bytes,5,opt,name=authenticator,proto3" json:"authenticator,omitempty"`
}
WebauthnCredential contains all needed information about a WebAuthn credential for storage
func ConvertStdCredential ¶
func ConvertStdCredential(wa *webauthn.Credential) *WebauthnCredential
ConvertStdCredential creates a common.WebauthnCredential from a webauthn.Credential from the go-webauthn package
func NewWebAuthnCredential ¶
func NewWebAuthnCredential(c *protocol.ParsedCredentialCreationData) *WebauthnCredential
NewWebAuthnCredential creates a new WebauthnCredential from a ParsedCredentialCreationData and contains all needed information about a WebAuthn credential for storage. This is then used to create a VerificationMethod for the DID Document.
func (*WebauthnCredential) Descriptor ¶
func (*WebauthnCredential) Descriptor() ([]byte, []int)
func (*WebauthnCredential) Did ¶
func (c *WebauthnCredential) Did() string
Did returns the DID for a WebauthnCredential
func (*WebauthnCredential) FromMetadata ¶ added in v0.3.0
func (c *WebauthnCredential) FromMetadata(m map[string]string) error
FromMetadata converts a map[string]string into a common WebauthnCredential
func (*WebauthnCredential) GetAttestationType ¶
func (m *WebauthnCredential) GetAttestationType() string
func (*WebauthnCredential) GetAuthenticator ¶
func (m *WebauthnCredential) GetAuthenticator() *WebauthnAuthenticator
func (*WebauthnCredential) GetId ¶
func (m *WebauthnCredential) GetId() []byte
func (*WebauthnCredential) GetPublicKey ¶
func (m *WebauthnCredential) GetPublicKey() []byte
func (*WebauthnCredential) GetTransport ¶
func (m *WebauthnCredential) GetTransport() []string
func (*WebauthnCredential) Marshal ¶
func (m *WebauthnCredential) Marshal() (dAtA []byte, err error)
func (*WebauthnCredential) MarshalTo ¶
func (m *WebauthnCredential) MarshalTo(dAtA []byte) (int, error)
func (*WebauthnCredential) MarshalToSizedBuffer ¶
func (m *WebauthnCredential) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*WebauthnCredential) ProtoMessage ¶
func (*WebauthnCredential) ProtoMessage()
func (*WebauthnCredential) PublicKeyMultibase ¶
func (c *WebauthnCredential) PublicKeyMultibase() string
PublicKeyMultibase returns the public key in multibase format
func (*WebauthnCredential) Reset ¶
func (m *WebauthnCredential) Reset()
func (*WebauthnCredential) Size ¶
func (m *WebauthnCredential) Size() (n int)
func (*WebauthnCredential) String ¶
func (m *WebauthnCredential) String() string
func (*WebauthnCredential) ToMetadata ¶
func (c *WebauthnCredential) ToMetadata() map[string]string
ToMetadata converts a common WebauthnCredential into a map[string]string
func (*WebauthnCredential) ToStdCredential ¶
func (c *WebauthnCredential) ToStdCredential() *webauthn.Credential
ToStdCredential converts a common WebauthnCredential to one that can be used for the go-webauthn package
func (*WebauthnCredential) Unmarshal ¶
func (m *WebauthnCredential) Unmarshal(dAtA []byte) error
func (*WebauthnCredential) Validate ¶
func (c *WebauthnCredential) Validate(pc *webauthn.Credential) error
Validate verifies that this WebauthnCredential is identical to the go-webauthn package credential
func (*WebauthnCredential) XXX_DiscardUnknown ¶
func (m *WebauthnCredential) XXX_DiscardUnknown()
func (*WebauthnCredential) XXX_Marshal ¶
func (m *WebauthnCredential) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*WebauthnCredential) XXX_Merge ¶
func (m *WebauthnCredential) XXX_Merge(src proto.Message)
func (*WebauthnCredential) XXX_Size ¶
func (m *WebauthnCredential) XXX_Size() int
func (*WebauthnCredential) XXX_Unmarshal ¶
func (m *WebauthnCredential) XXX_Unmarshal(b []byte) error