crypto

package
v0.7.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2023 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthCoin        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCoin          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupCoin = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthSsi        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSsi          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSsi = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthVc        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowVc          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupVc = fmt.Errorf("proto: unexpected end of group")
)
View Source
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",
}
View Source
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,
}
View Source
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",
}
View Source
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,
}
View Source
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",
}
View Source
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,
}

Functions

func Base64UrlToBytes added in v0.6.5

func Base64UrlToBytes(base64Url string) ([]byte, error)

func BitcoinAddress added in v0.5.0

func BitcoinAddress(pk *PubKey) string

func EthereumAddress added in v0.5.0

func EthereumAddress(pk *PubKey) string

func ParseCredentialPublicKey added in v0.6.5

func ParseCredentialPublicKey(pubStr string) (interface{}, error)

Types

type AccountData added in v0.7.1

type AccountData struct {
	Address   string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	Algo      string `protobuf:"bytes,2,opt,name=algo,proto3" json:"algo,omitempty"`
	PublicKey []byte `protobuf:"bytes,3,opt,name=publicKey,proto3" json:"publicKey,omitempty"`
}

func (*AccountData) Descriptor added in v0.7.1

func (*AccountData) Descriptor() ([]byte, []int)

func (*AccountData) GetAddress added in v0.7.1

func (m *AccountData) GetAddress() string

func (*AccountData) GetAlgo added in v0.7.1

func (m *AccountData) GetAlgo() string

func (*AccountData) GetPublicKey added in v0.7.1

func (m *AccountData) GetPublicKey() []byte

func (*AccountData) Marshal added in v0.7.1

func (m *AccountData) Marshal() (dAtA []byte, err error)

func (*AccountData) MarshalTo added in v0.7.1

func (m *AccountData) MarshalTo(dAtA []byte) (int, error)

func (*AccountData) MarshalToSizedBuffer added in v0.7.1

func (m *AccountData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AccountData) ProtoMessage added in v0.7.1

func (*AccountData) ProtoMessage()

func (*AccountData) Reset added in v0.7.1

func (m *AccountData) Reset()

func (*AccountData) Size added in v0.7.1

func (m *AccountData) Size() (n int)

func (*AccountData) String added in v0.7.1

func (m *AccountData) String() string

func (*AccountData) Unmarshal added in v0.7.1

func (m *AccountData) Unmarshal(dAtA []byte) error

func (*AccountData) XXX_DiscardUnknown added in v0.7.1

func (m *AccountData) XXX_DiscardUnknown()

func (*AccountData) XXX_Marshal added in v0.7.1

func (m *AccountData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AccountData) XXX_Merge added in v0.7.1

func (m *AccountData) XXX_Merge(src proto.Message)

func (*AccountData) XXX_Size added in v0.7.1

func (m *AccountData) XXX_Size() int

func (*AccountData) XXX_Unmarshal added in v0.7.1

func (m *AccountData) XXX_Unmarshal(b []byte) error

type Address

type Address = tmcrypto.HexBytes

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 AllCoinTypes

func AllCoinTypes() []CoinType

AllCoinTypes returns all the coin types.

func CoinTypeFromAddrPrefix

func CoinTypeFromAddrPrefix(str string) CoinType

CoinTypeFromAddrPrefix returns the CoinType from the string.

func CoinTypeFromBipPath

func CoinTypeFromBipPath(i uint32) CoinType

CoinTypeFromBipPath returns the CoinType from the index.

func CoinTypeFromDidMethod

func CoinTypeFromDidMethod(str string) CoinType

CoinTypeFromDIDMethod returns the CoinType from the DID method.

func CoinTypeFromName

func CoinTypeFromName(str string) CoinType

CoinTypeFromName returns the CoinType from the name.

func CoinTypeFromTicker

func CoinTypeFromTicker(str string) CoinType

CoinTypeFromTicker returns the CoinType from the symbol.

func (CoinType) AddrPrefix

func (ct CoinType) AddrPrefix() string

AddrPrefix returns the address prefix for the given coin type.

func (CoinType) BipPath

func (ct CoinType) BipPath() uint32

BipPath returns the index for the given coin type.

func (CoinType) DIDMethod added in v0.7.1

func (c CoinType) DIDMethod() string

DIDMethod returns the DID method for the given coin type.

func (CoinType) EnumDescriptor

func (CoinType) EnumDescriptor() ([]byte, []int)

func (CoinType) FormatAddress added in v0.5.0

func (c CoinType) FormatAddress(pk *PubKey) string

FormatAddress returns the address for the given public key for the spec of the coin type.

func (CoinType) FormatDID added in v0.6.0

func (c CoinType) FormatDID(pk *PubKey) (string, string)

FormatDID returns the DID for the given public key for the spec of the coin type, along with the address.

func (CoinType) IsBitcoin

func (c CoinType) IsBitcoin() bool

IsBitcoin returns true if the coin type is bitcoin.

func (CoinType) IsCosmos

func (c CoinType) IsCosmos() bool

IsCosmos returns true if the coin type is cosmos.

func (CoinType) IsDogecoin

func (c CoinType) IsDogecoin() bool

IsDogecoin returns true if the coin type is dogecoin.

func (CoinType) IsEthereum

func (c CoinType) IsEthereum() bool

IsEthereum returns true if the coin type is ethereum.

func (CoinType) IsFilecoin

func (c CoinType) IsFilecoin() bool

IsFilecoin returns true if the coin type is filecoin.

func (CoinType) IsHandshake

func (c CoinType) IsHandshake() bool

IsHandshake returns true if the coin type is handshake.

func (CoinType) IsLitecoin

func (c CoinType) IsLitecoin() bool

IsLitecoin returns true if the coin type is litecoin.

func (CoinType) IsRipple

func (c CoinType) IsRipple() bool

IsRipple returns true if the coin type is ripple.

func (CoinType) IsSolana

func (c CoinType) IsSolana() bool

IsSolana returns true if the coin type is solana.

func (CoinType) IsSonr

func (c CoinType) IsSonr() bool

IsSonr returns true if the coin type is sonr.

func (CoinType) IsTestnet

func (c CoinType) IsTestnet() bool

IsTestnet returns true if the coin type is testnet.

func (CoinType) Name

func (ct CoinType) Name() string

Name returns the name for the given coin type.

func (CoinType) String

func (x CoinType) String() string

func (CoinType) Ticker

func (ct CoinType) Ticker() string

Ticker returns the symbol for the given coin type for exchanges.

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

func KeyTypeFromMulticodec(code uint64) (KeyType, error)

KeyTypeFromMulticodec returns the key type

func KeyTypeFromPrettyString

func KeyTypeFromPrettyString(s string) (KeyType, error)

KeyTypeFromPrettyString returns the key type

func (KeyType) EnumDescriptor

func (KeyType) EnumDescriptor() ([]byte, []int)

func (KeyType) FormatString

func (kt KeyType) FormatString() string

func (KeyType) IsBlockchainKey added in v0.5.0

func (kt KeyType) IsBlockchainKey() bool

IsBlockchainKey returns true if the key is a edsa or secp256k1 key

func (KeyType) IsWebAuthnKey added in v0.5.0

func (kt KeyType) IsWebAuthnKey() bool

IsWebAuthnKey returns true if the key is a webauthn key

func (KeyType) MulticodecType

func (kt KeyType) MulticodecType() uint64

-- 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

func (kt KeyType) PrettyString() string

PrettyString returns the string representation of the key type

func (KeyType) String

func (x KeyType) String() string

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=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) Descriptor() ([]byte, []int)

func (*Proof) GetCreated

func (m *Proof) GetCreated() string

func (*Proof) GetDomain

func (m *Proof) GetDomain() string

func (*Proof) GetProofPurpose

func (m *Proof) GetProofPurpose() string

func (*Proof) GetType

func (m *Proof) GetType() ProofType

func (*Proof) GetVerificationMethod

func (m *Proof) GetVerificationMethod() string

func (*Proof) Marshal

func (m *Proof) Marshal() (dAtA []byte, err error)

func (*Proof) MarshalTo

func (m *Proof) MarshalTo(dAtA []byte) (int, error)

func (*Proof) MarshalToSizedBuffer

func (m *Proof) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Proof) ProtoMessage

func (*Proof) ProtoMessage()

func (*Proof) Reset

func (m *Proof) Reset()

func (*Proof) Size

func (m *Proof) Size() (n int)

func (*Proof) String

func (m *Proof) String() string

func (*Proof) Unmarshal

func (m *Proof) Unmarshal(dAtA []byte) error

func (*Proof) XXX_DiscardUnknown

func (m *Proof) XXX_DiscardUnknown()

func (*Proof) XXX_Marshal

func (m *Proof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Proof) XXX_Merge

func (m *Proof) XXX_Merge(src proto.Message)

func (*Proof) XXX_Size

func (m *Proof) XXX_Size() int

func (*Proof) XXX_Unmarshal

func (m *Proof) XXX_Unmarshal(b []byte) error

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) EnumDescriptor() ([]byte, []int)

func (ProofType) FormatString

func (kt ProofType) FormatString() string

func (ProofType) String

func (x ProofType) String() string

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"`
}

PubKey represents a public key in bytes format.

func NewPubKey

func NewPubKey(bz []byte, kt KeyType) *PubKey

NewPubKey takes a byte array and returns a PubKey

func NewSecp256k1PubKey added in v0.7.1

func NewSecp256k1PubKey(pk *secp256k1.PubKey) *PubKey

func (*PubKey) Address

func (pk *PubKey) Address() Address

Creating a new method called Address() that returns an Address type.

func (*PubKey) Base64 added in v0.5.0

func (pk *PubKey) Base64() string

Base64 returns the base64 encoding of the key.

func (*PubKey) Blake3 added in v0.5.0

func (pk *PubKey) Blake3() string

Blake3 returns the blake3 hash of the key.

func (*PubKey) Btcec added in v0.5.0

func (pk *PubKey) Btcec() (*btcec.PublicKey, error)

Btcec returns the btcec public key.

func (*PubKey) Bytes

func (pk *PubKey) Bytes() []byte

Returning the key in bytes.

func (*PubKey) Descriptor

func (*PubKey) Descriptor() ([]byte, []int)

func (*PubKey) Equals

func (pk *PubKey) Equals(other cryptotypes.PubKey) bool

Comparing the two keys.

func (*PubKey) GetKey

func (m *PubKey) GetKey() []byte

func (*PubKey) GetKeyType

func (m *PubKey) GetKeyType() string

func (*PubKey) Marshal

func (m *PubKey) Marshal() (dAtA []byte, err error)

func (*PubKey) MarshalTo

func (m *PubKey) MarshalTo(dAtA []byte) (int, error)

func (*PubKey) MarshalToSizedBuffer

func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PubKey) Multibase

func (pk *PubKey) Multibase() string

Multibase returns the Base58 encoding the key.

func (*PubKey) ProtoMessage

func (*PubKey) ProtoMessage()

func (*PubKey) Raw

func (pk *PubKey) Raw() []byte

Raw returns the raw key without the type.

func (*PubKey) Reset

func (m *PubKey) Reset()

func (*PubKey) Secp256k1 added in v0.5.0

func (pk *PubKey) Secp256k1() (*secp256k1.PubKey, error)

Returning the secp256k1 public key.

func (*PubKey) Secp256k1AnyProto added in v0.6.20

func (pk *PubKey) Secp256k1AnyProto() (*codectypes.Any, error)

Secp256k1AnyProto returns the pubkey for cosmos transactions

func (*PubKey) Size

func (m *PubKey) Size() (n int)

func (*PubKey) String

func (m *PubKey) String() string

func (*PubKey) Type

func (pk *PubKey) Type() string

Returning the type of the key.

func (*PubKey) Unmarshal

func (m *PubKey) Unmarshal(dAtA []byte) error

func (*PubKey) VerifySignature

func (pk *PubKey) VerifySignature(msg []byte, sig []byte) bool

Verifying the signature of the message.

func (*PubKey) XXX_DiscardUnknown

func (m *PubKey) XXX_DiscardUnknown()

func (*PubKey) XXX_Marshal

func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PubKey) XXX_Merge

func (m *PubKey) XXX_Merge(src proto.Message)

func (*PubKey) XXX_Size

func (m *PubKey) XXX_Size() int

func (*PubKey) XXX_Unmarshal

func (m *PubKey) XXX_Unmarshal(b []byte) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL