Documentation ¶
Index ¶
- Variables
- func Base64UrlToBytes(base64Url string) ([]byte, error)
- func BitcoinAddress(pk *PubKey) string
- func ConvertBoolToString(v bool) string
- func ConvertStringToBool(v string) bool
- func EthereumAddress(pk *PubKey) string
- func ParseCredentialPublicKey(pubStr string) (interface{}, error)
- type Address
- type CoinType
- func (ct CoinType) AddrPrefix() string
- func (ct CoinType) BipPath() int32
- func (c CoinType) DidMethod() string
- func (CoinType) EnumDescriptor() ([]byte, []int)
- func (c CoinType) FormatAddress(pk *PubKey) string
- func (c CoinType) FormatDID(pk *PubKey) (string, string)
- func (c CoinType) IsBitcoin() bool
- func (c CoinType) IsCosmos() bool
- func (c CoinType) IsDogecoin() bool
- func (c CoinType) IsEthereum() bool
- func (c CoinType) IsFilecoin() bool
- func (c CoinType) IsHandshake() bool
- func (c CoinType) IsLitecoin() bool
- func (c CoinType) IsRipple() bool
- func (c CoinType) IsSolana() bool
- func (c CoinType) IsSonr() bool
- func (c CoinType) IsTestnet() bool
- func (ct CoinType) Name() string
- func (x CoinType) String() string
- func (ct CoinType) Ticker() string
- type JSONWebSignature2020Proof
- func (*JSONWebSignature2020Proof) Descriptor() ([]byte, []int)
- func (m *JSONWebSignature2020Proof) GetJws() string
- func (m *JSONWebSignature2020Proof) GetProof() *Proof
- func (m *JSONWebSignature2020Proof) Marshal() (dAtA []byte, err error)
- func (m *JSONWebSignature2020Proof) MarshalTo(dAtA []byte) (int, error)
- func (m *JSONWebSignature2020Proof) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*JSONWebSignature2020Proof) ProtoMessage()
- func (m *JSONWebSignature2020Proof) Reset()
- func (m *JSONWebSignature2020Proof) Size() (n int)
- func (m *JSONWebSignature2020Proof) String() string
- func (m *JSONWebSignature2020Proof) Unmarshal(dAtA []byte) error
- func (m *JSONWebSignature2020Proof) XXX_DiscardUnknown()
- func (m *JSONWebSignature2020Proof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *JSONWebSignature2020Proof) XXX_Merge(src proto.Message)
- func (m *JSONWebSignature2020Proof) XXX_Size() int
- func (m *JSONWebSignature2020Proof) XXX_Unmarshal(b []byte) error
- type KeyType
- type Proof
- func (*Proof) Descriptor() ([]byte, []int)
- func (m *Proof) GetCreated() string
- func (m *Proof) GetDomain() string
- func (m *Proof) GetProofPurpose() string
- func (m *Proof) GetType() ProofType
- func (m *Proof) GetVerificationMethod() string
- func (m *Proof) Marshal() (dAtA []byte, err error)
- func (m *Proof) MarshalTo(dAtA []byte) (int, error)
- func (m *Proof) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Proof) ProtoMessage()
- func (m *Proof) Reset()
- func (m *Proof) Size() (n int)
- func (m *Proof) String() string
- func (m *Proof) Unmarshal(dAtA []byte) error
- func (m *Proof) XXX_DiscardUnknown()
- func (m *Proof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Proof) XXX_Merge(src proto.Message)
- func (m *Proof) XXX_Size() int
- func (m *Proof) XXX_Unmarshal(b []byte) error
- type ProofType
- type PubKey
- func (pk *PubKey) Address() Address
- func (pk *PubKey) Base64() string
- func (pk *PubKey) Blake3() string
- func (pk *PubKey) Btcec() (*btcec.PublicKey, error)
- func (pk *PubKey) Bytes() []byte
- func (*PubKey) Descriptor() ([]byte, []int)
- func (pk *PubKey) Equals(other cryptotypes.PubKey) bool
- func (m *PubKey) GetKey() []byte
- func (m *PubKey) GetKeyType() string
- func (m *PubKey) Marshal() (dAtA []byte, err error)
- func (m *PubKey) MarshalTo(dAtA []byte) (int, error)
- func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (pk *PubKey) Multibase() string
- func (*PubKey) ProtoMessage()
- func (pk *PubKey) Raw() []byte
- func (m *PubKey) Reset()
- func (pk *PubKey) Secp256k1() (*secp256k1.PubKey, error)
- func (m *PubKey) Size() (n int)
- func (m *PubKey) String() string
- func (pk *PubKey) Type() string
- func (m *PubKey) Unmarshal(dAtA []byte) error
- func (pk *PubKey) VerifySignature(msg []byte, sig []byte) bool
- func (m *PubKey) XXX_DiscardUnknown()
- func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PubKey) XXX_Merge(src proto.Message)
- func (m *PubKey) XXX_Size() int
- func (m *PubKey) XXX_Unmarshal(b []byte) error
- type ServiceType
- type VerifiableCredential
- func (*VerifiableCredential) Descriptor() ([]byte, []int)
- func (m *VerifiableCredential) GetContext() []string
- func (m *VerifiableCredential) GetCredentialSubject() map[string]string
- func (m *VerifiableCredential) GetExpirationDate() string
- func (m *VerifiableCredential) GetId() string
- func (m *VerifiableCredential) GetIssuanceDate() string
- func (m *VerifiableCredential) GetIssuer() string
- func (m *VerifiableCredential) GetProof() map[string]string
- func (m *VerifiableCredential) GetType() []string
- func (m *VerifiableCredential) Marshal() (dAtA []byte, err error)
- func (m *VerifiableCredential) MarshalTo(dAtA []byte) (int, error)
- func (m *VerifiableCredential) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*VerifiableCredential) ProtoMessage()
- func (m *VerifiableCredential) Reset()
- func (m *VerifiableCredential) Size() (n int)
- func (m *VerifiableCredential) String() string
- func (m *VerifiableCredential) Unmarshal(dAtA []byte) error
- func (m *VerifiableCredential) XXX_DiscardUnknown()
- func (m *VerifiableCredential) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *VerifiableCredential) XXX_Merge(src proto.Message)
- func (m *VerifiableCredential) XXX_Size() int
- func (m *VerifiableCredential) XXX_Unmarshal(b []byte) error
- 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 (c *WebauthnCredential) DID() string
- func (*WebauthnCredential) Descriptor() ([]byte, []int)
- 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) PubKey() *PubKey
- 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 (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 ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthCredential = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowCredential = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupCredential = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthPubkey = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowPubkey = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupPubkey = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthVc = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowVc = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupVc = fmt.Errorf("proto: unexpected end of group") )
var CoinType_name = map[int32]string{
0: "CoinType_BITCOIN",
1: "CoinType_TESTNET",
2: "CoinType_LITECOIN",
3: "CoinType_DOGE",
4: "CoinType_ETHEREUM",
5: "CoinType_SONR",
6: "CoinType_COSMOS",
7: "CoinType_FILECOIN",
8: "CoinType_HNS",
9: "CoinType_SOLANA",
10: "CoinType_XRP",
}
var CoinType_value = map[string]int32{
"CoinType_BITCOIN": 0,
"CoinType_TESTNET": 1,
"CoinType_LITECOIN": 2,
"CoinType_DOGE": 3,
"CoinType_ETHEREUM": 4,
"CoinType_SONR": 5,
"CoinType_COSMOS": 6,
"CoinType_FILECOIN": 7,
"CoinType_HNS": 8,
"CoinType_SOLANA": 9,
"CoinType_XRP": 10,
}
var KeyType_name = map[int32]string{
0: "KeyType_UNSPECIFIED",
1: "KeyType_JSON_WEB_KEY_2020",
2: "KeyType_ED25519_VERIFICATION_KEY_2018",
3: "KeyType_ECDSA_SECP256K1_VERIFICATION_KEY_2019",
4: "KeyType_RSA_VERIFICATION_KEY_2018",
5: "KeyType_WEB_AUTHN_AUTHENTICATION_2018",
}
var KeyType_value = map[string]int32{
"KeyType_UNSPECIFIED": 0,
"KeyType_JSON_WEB_KEY_2020": 1,
"KeyType_ED25519_VERIFICATION_KEY_2018": 2,
"KeyType_ECDSA_SECP256K1_VERIFICATION_KEY_2019": 3,
"KeyType_RSA_VERIFICATION_KEY_2018": 4,
"KeyType_WEB_AUTHN_AUTHENTICATION_2018": 5,
}
var ProofType_name = map[int32]string{
0: "ProofType_UNSPECIFIED",
1: "ProofType_JSON_WEB_SIGNATURE_2020",
2: "ProofType_ED25519_SIGNATURE_2018",
3: "ProofType_ECDSA_SECP256K1_SIGNATURE_2019",
4: "ProofType_RSA_SIGNATURE_2018",
}
var ProofType_value = map[string]int32{
"ProofType_UNSPECIFIED": 0,
"ProofType_JSON_WEB_SIGNATURE_2020": 1,
"ProofType_ED25519_SIGNATURE_2018": 2,
"ProofType_ECDSA_SECP256K1_SIGNATURE_2019": 3,
"ProofType_RSA_SIGNATURE_2018": 4,
}
var ServiceType_name = map[int32]string{
0: "ServiceType_UNSPECIFIED",
1: "ServiceType_DID_COMM_MESSAGING",
2: "ServiceType_ENCRYPTED_DATA_VAULT",
3: "ServiceType_LINKED_DOMAINS",
}
var ServiceType_value = map[string]int32{
"ServiceType_UNSPECIFIED": 0,
"ServiceType_DID_COMM_MESSAGING": 1,
"ServiceType_ENCRYPTED_DATA_VAULT": 2,
"ServiceType_LINKED_DOMAINS": 3,
}
Functions ¶
func Base64UrlToBytes ¶ added in v0.6.5
func BitcoinAddress ¶ added in v0.5.0
func ConvertBoolToString ¶
func ConvertStringToBool ¶
func EthereumAddress ¶ added in v0.5.0
func ParseCredentialPublicKey ¶ added in v0.6.5
Types ¶
type CoinType ¶
type CoinType int32
CoinType is the BIP-0044 coin type for each supported coin.
const ( // Bitcoins coin type is 0 CoinType_CoinType_BITCOIN CoinType = 0 // Testnet coin type is 1 CoinType_CoinType_TESTNET CoinType = 1 // Litecoin coin type is 2 CoinType_CoinType_LITECOIN CoinType = 2 // Dogecoin coin type is 3 CoinType_CoinType_DOGE CoinType = 3 // Ethereum coin type is 60 CoinType_CoinType_ETHEREUM CoinType = 4 // Sonr coin type is 703 CoinType_CoinType_SONR CoinType = 5 // Cosmos coin type is 118 CoinType_CoinType_COSMOS CoinType = 6 // Filecoin coin type is 461 CoinType_CoinType_FILECOIN CoinType = 7 // Handshake coin type is 5353 CoinType_CoinType_HNS CoinType = 8 // Solana coin type is 501 CoinType_CoinType_SOLANA CoinType = 9 // Ripple coin type is 144 CoinType_CoinType_XRP CoinType = 10 )
func CoinTypeFromAddrPrefix ¶
CoinTypeFromAddrPrefix returns the CoinType from the string.
func CoinTypeFromBipPath ¶
CoinTypeFromBipPath returns the CoinType from the index.
func CoinTypeFromDidMethod ¶
CoinTypeFromDIDMethod returns the CoinType from the DID method.
func CoinTypeFromName ¶
CoinTypeFromName returns the CoinType from the name.
func CoinTypeFromTicker ¶
CoinTypeFromTicker returns the CoinType from the symbol.
func (CoinType) AddrPrefix ¶
AddrPrefix returns the address prefix for the given coin type.
func (CoinType) EnumDescriptor ¶
func (CoinType) FormatAddress ¶ added in v0.5.0
FormatAddress returns the address for the given public key for the spec of the coin type.
func (CoinType) FormatDID ¶ added in v0.6.0
FormatDID returns the DID for the given public key for the spec of the coin type, along with the address.
func (CoinType) IsDogecoin ¶
IsDogecoin returns true if the coin type is dogecoin.
func (CoinType) IsEthereum ¶
IsEthereum returns true if the coin type is ethereum.
func (CoinType) IsFilecoin ¶
IsFilecoin returns true if the coin type is filecoin.
func (CoinType) IsHandshake ¶
IsHandshake returns true if the coin type is handshake.
func (CoinType) IsLitecoin ¶
IsLitecoin returns true if the coin type is litecoin.
type JSONWebSignature2020Proof ¶
type JSONWebSignature2020Proof struct { Proof *Proof `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"` Jws string `protobuf:"bytes,2,opt,name=jws,proto3" json:"jws,omitempty"` }
JSONWebSignature2020Proof is a VC proof with a signature according to JsonWebSignature2020
func (*JSONWebSignature2020Proof) Descriptor ¶
func (*JSONWebSignature2020Proof) Descriptor() ([]byte, []int)
func (*JSONWebSignature2020Proof) GetJws ¶
func (m *JSONWebSignature2020Proof) GetJws() string
func (*JSONWebSignature2020Proof) GetProof ¶
func (m *JSONWebSignature2020Proof) GetProof() *Proof
func (*JSONWebSignature2020Proof) Marshal ¶
func (m *JSONWebSignature2020Proof) Marshal() (dAtA []byte, err error)
func (*JSONWebSignature2020Proof) MarshalTo ¶
func (m *JSONWebSignature2020Proof) MarshalTo(dAtA []byte) (int, error)
func (*JSONWebSignature2020Proof) MarshalToSizedBuffer ¶
func (m *JSONWebSignature2020Proof) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*JSONWebSignature2020Proof) ProtoMessage ¶
func (*JSONWebSignature2020Proof) ProtoMessage()
func (*JSONWebSignature2020Proof) Reset ¶
func (m *JSONWebSignature2020Proof) Reset()
func (*JSONWebSignature2020Proof) Size ¶
func (m *JSONWebSignature2020Proof) Size() (n int)
func (*JSONWebSignature2020Proof) String ¶
func (m *JSONWebSignature2020Proof) String() string
func (*JSONWebSignature2020Proof) Unmarshal ¶
func (m *JSONWebSignature2020Proof) Unmarshal(dAtA []byte) error
func (*JSONWebSignature2020Proof) XXX_DiscardUnknown ¶
func (m *JSONWebSignature2020Proof) XXX_DiscardUnknown()
func (*JSONWebSignature2020Proof) XXX_Marshal ¶
func (m *JSONWebSignature2020Proof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*JSONWebSignature2020Proof) XXX_Merge ¶
func (m *JSONWebSignature2020Proof) XXX_Merge(src proto.Message)
func (*JSONWebSignature2020Proof) XXX_Size ¶
func (m *JSONWebSignature2020Proof) XXX_Size() int
func (*JSONWebSignature2020Proof) XXX_Unmarshal ¶
func (m *JSONWebSignature2020Proof) XXX_Unmarshal(b []byte) error
type KeyType ¶
type KeyType int32
KeyType is the type of key used to sign a DID document.
const ( // No key type specified KeyType_KeyType_UNSPECIFIED KeyType = 0 // JsonWebKey2020 is a VerificationMethod type. https://w3c-ccg.github.io/lds-jws2020/ KeyType_KeyType_JSON_WEB_KEY_2020 KeyType = 1 // ED25519VerificationKey2018 is the Ed25519VerificationKey2018 verification key type as specified here: https://w3c-ccg.github.io/lds-ed25519-2018/ KeyType_KeyType_ED25519_VERIFICATION_KEY_2018 KeyType = 2 // ECDSASECP256K1VerificationKey2019 is the EcdsaSecp256k1VerificationKey2019 verification key type as specified here: https://w3c-ccg.github.io/lds-ecdsa-secp256k1-2019/ KeyType_KeyType_ECDSA_SECP256K1_VERIFICATION_KEY_2019 KeyType = 3 // RSAVerificationKey2018 is the RsaVerificationKey2018 verification key type as specified here: https://w3c-ccg.github.io/lds-rsa2018/ KeyType_KeyType_RSA_VERIFICATION_KEY_2018 KeyType = 4 // WebAuthnAuthentication2018 is the WebAuthnAuthentication2018 verification key type as specified here: https://w3c-ccg.github.io/lds-webauthn/ KeyType_KeyType_WEB_AUTHN_AUTHENTICATION_2018 KeyType = 5 )
func KeyTypeFromMulticodec ¶
KeyTypeFromMulticodec returns the key type
func KeyTypeFromPrettyString ¶
KeyTypeFromPrettyString returns the key type
func (KeyType) EnumDescriptor ¶
func (KeyType) FormatString ¶
func (KeyType) IsBlockchainKey ¶ added in v0.5.0
IsBlockchainKey returns true if the key is a edsa or secp256k1 key
func (KeyType) IsWebAuthnKey ¶ added in v0.5.0
IsWebAuthnKey returns true if the key is a webauthn key
func (KeyType) MulticodecType ¶
-- We represent those as raw public key bytes prefixed with public key -- multiformat code. | secp256k1 "0xe7" | Ed25519 "0xed" | P256 "0x1200" | P384 "0x1201" | P512 "0x1202" | RSA "0x1205"
MulticodecType returns the multicodec code for the key type
func (KeyType) PrettyString ¶
PrettyString returns the string representation of the key type
type Proof ¶
type Proof struct { // Type defines the specific proof type used. For example, an Ed25519Signature2018 type indicates that the proof includes a digital signature produced by an ed25519 cryptographic key. Type ProofType `protobuf:"varint,1,opt,name=type,proto3,enum=sonrhq.sonr.crypto.ProofType" json:"type,omitempty"` // ProofPurpose defines the intent for the proof, the reason why an entity created it. Acts as a safeguard to prevent the proof from being misused for a purpose other than the one it was intended for. ProofPurpose string `protobuf:"bytes,2,opt,name=proof_purpose,json=proofPurpose,proto3" json:"proof_purpose,omitempty"` // VerificationMethod points to the ID that can be used to verify the proof, eg: a public key. VerificationMethod string `protobuf:"bytes,3,opt,name=verification_method,json=verificationMethod,proto3" json:"verification_method,omitempty"` // Created notes when the proof was created using a iso8601 string Created string `protobuf:"bytes,4,opt,name=created,proto3" json:"created,omitempty"` // Domain specifies the restricted domain of the proof Domain string `protobuf:"bytes,5,opt,name=domain,proto3" json:"domain,omitempty"` }
Proof represents a credential/presentation proof as defined by the Linked Data Proofs 1.0 specification (https://w3c-ccg.github.io/ld-proofs/).
func (*Proof) Descriptor ¶
func (*Proof) GetCreated ¶
func (*Proof) GetProofPurpose ¶
func (*Proof) GetVerificationMethod ¶
func (*Proof) ProtoMessage ¶
func (*Proof) ProtoMessage()
func (*Proof) XXX_DiscardUnknown ¶
func (m *Proof) XXX_DiscardUnknown()
func (*Proof) XXX_Marshal ¶
func (*Proof) XXX_Unmarshal ¶
type ProofType ¶
type ProofType int32
ProofType is the type of proof used to present claims over a DID document.
const ( // No proof type specified ProofType_ProofType_UNSPECIFIED ProofType = 0 // JsonWebSignature2020 is a proof type. https://w3c-ccg.github.io/lds-jws2020/ ProofType_ProofType_JSON_WEB_SIGNATURE_2020 ProofType = 1 // ED25519Signature2018 is the Ed25519Signature2018 proof type as specified here: https://w3c-ccg.github.io/lds-ed25519-2018/ ProofType_ProofType_ED25519_SIGNATURE_2018 ProofType = 2 // EcdsaSecp256k1Signature2019 is the EcdsaSecp256k1Signature2019 proof type as specified here: https://w3c-ccg.github.io/lds-ecdsa-secp256k1-2019/ ProofType_ProofType_ECDSA_SECP256K1_SIGNATURE_2019 ProofType = 3 // RsaSignature2018 is the RsaSignature2018 proof type as specified here: https://w3c-ccg.github.io/lds-rsa2018/ ProofType_ProofType_RSA_SIGNATURE_2018 ProofType = 4 )
func (ProofType) EnumDescriptor ¶
func (ProofType) FormatString ¶
type PubKey ¶
type PubKey struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` KeyType string `protobuf:"bytes,2,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"` }
func (*PubKey) Descriptor ¶
func (*PubKey) Equals ¶
func (pk *PubKey) Equals(other cryptotypes.PubKey) bool
Comparing the two keys.
func (*PubKey) GetKeyType ¶
func (*PubKey) MarshalToSizedBuffer ¶
func (*PubKey) ProtoMessage ¶
func (*PubKey) ProtoMessage()
func (*PubKey) VerifySignature ¶
Verifying the signature of the message.
func (*PubKey) XXX_DiscardUnknown ¶
func (m *PubKey) XXX_DiscardUnknown()
func (*PubKey) XXX_Marshal ¶
func (*PubKey) XXX_Unmarshal ¶
type ServiceType ¶
type ServiceType int32
ServiceType is the type of service used to provide a DID document.
const ( // No service type specified ServiceType_ServiceType_UNSPECIFIED ServiceType = 0 // DIDCommMessaging is the DIDCommMessaging service type as specified here: https://identity.foundation/didcomm-messaging/spec/ ServiceType_ServiceType_DID_COMM_MESSAGING ServiceType = 1 // EncryptedDataVault is the EncryptedDataVault service type as specified here: https://identity.foundation/edv-spec/ ServiceType_ServiceType_ENCRYPTED_DATA_VAULT ServiceType = 2 // LinkedDomains is the LinkedDomains service type as specified here: https://identity.foundation/linked-domains/ ServiceType_ServiceType_LINKED_DOMAINS ServiceType = 3 )
func (ServiceType) EnumDescriptor ¶
func (ServiceType) EnumDescriptor() ([]byte, []int)
func (ServiceType) FormatString ¶
func (kt ServiceType) FormatString() string
func (ServiceType) String ¶
func (x ServiceType) String() string
type VerifiableCredential ¶
type VerifiableCredential struct { // ID is the unique identifier for the credential. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Context is a list of URIs that define the context of the credential. Context []string `protobuf:"bytes,2,rep,name=context,proto3" json:"context,omitempty"` // Type is a list of URIs that define the type of the credential. Type []string `protobuf:"bytes,3,rep,name=type,proto3" json:"type,omitempty"` // Issuer is the DID of the issuer of the credential. Issuer string `protobuf:"bytes,4,opt,name=issuer,proto3" json:"issuer,omitempty"` // IssuanceDate is the date the credential was issued. IssuanceDate string `protobuf:"bytes,5,opt,name=issuance_date,json=issuanceDate,proto3" json:"issuance_date,omitempty"` // ExpirationDate is the date the credential expires. ExpirationDate string `protobuf:"bytes,6,opt,name=expiration_date,json=expirationDate,proto3" json:"expiration_date,omitempty"` // CredentialSubject is the subject of the credential. CredentialSubject map[string]string `` /* 200-byte string literal not displayed */ // Proof is the proof of the credential. Proof map[string]string `` /* 151-byte string literal not displayed */ }
VerifiableCredential represents a credential as defined by the Verifiable Credentials Data Model 1.0 specification (https://www.w3.org/TR/vc-data-model/).
func (*VerifiableCredential) Descriptor ¶
func (*VerifiableCredential) Descriptor() ([]byte, []int)
func (*VerifiableCredential) GetContext ¶
func (m *VerifiableCredential) GetContext() []string
func (*VerifiableCredential) GetCredentialSubject ¶
func (m *VerifiableCredential) GetCredentialSubject() map[string]string
func (*VerifiableCredential) GetExpirationDate ¶
func (m *VerifiableCredential) GetExpirationDate() string
func (*VerifiableCredential) GetId ¶
func (m *VerifiableCredential) GetId() string
func (*VerifiableCredential) GetIssuanceDate ¶
func (m *VerifiableCredential) GetIssuanceDate() string
func (*VerifiableCredential) GetIssuer ¶
func (m *VerifiableCredential) GetIssuer() string
func (*VerifiableCredential) GetProof ¶
func (m *VerifiableCredential) GetProof() map[string]string
func (*VerifiableCredential) GetType ¶
func (m *VerifiableCredential) GetType() []string
func (*VerifiableCredential) Marshal ¶
func (m *VerifiableCredential) Marshal() (dAtA []byte, err error)
func (*VerifiableCredential) MarshalTo ¶
func (m *VerifiableCredential) MarshalTo(dAtA []byte) (int, error)
func (*VerifiableCredential) MarshalToSizedBuffer ¶
func (m *VerifiableCredential) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*VerifiableCredential) ProtoMessage ¶
func (*VerifiableCredential) ProtoMessage()
func (*VerifiableCredential) Reset ¶
func (m *VerifiableCredential) Reset()
func (*VerifiableCredential) Size ¶
func (m *VerifiableCredential) Size() (n int)
func (*VerifiableCredential) String ¶
func (m *VerifiableCredential) String() string
func (*VerifiableCredential) Unmarshal ¶
func (m *VerifiableCredential) Unmarshal(dAtA []byte) error
func (*VerifiableCredential) XXX_DiscardUnknown ¶
func (m *VerifiableCredential) XXX_DiscardUnknown()
func (*VerifiableCredential) XXX_Marshal ¶
func (m *VerifiableCredential) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*VerifiableCredential) XXX_Merge ¶
func (m *VerifiableCredential) XXX_Merge(src proto.Message)
func (*VerifiableCredential) XXX_Size ¶
func (m *VerifiableCredential) XXX_Size() int
func (*VerifiableCredential) XXX_Unmarshal ¶
func (m *VerifiableCredential) XXX_Unmarshal(b []byte) error
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 CredentialFromDIDString ¶ added in v0.5.0
func CredentialFromDIDString(did string) (*WebauthnCredential, error)
CredentialFromDIDString converts a DID string into a WebauthnCredential
func (*WebauthnCredential) DID ¶ added in v0.4.4
func (c *WebauthnCredential) DID() string
Did returns the DID for a WebauthnCredential
func (*WebauthnCredential) Descriptor ¶
func (*WebauthnCredential) Descriptor() ([]byte, []int)
func (*WebauthnCredential) FromMetadata ¶
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) PubKey ¶ added in v0.5.0
func (c *WebauthnCredential) PubKey() *PubKey
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) 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