Documentation
¶
Index ¶
Constants ¶
const ( // KeyPrefix indicates a decentralized identifier that uses the key method KeyPrefix = "did:key" // MulticodecKindRSAPubKey rsa-x509-pub https://github.com/multiformats/multicodec/pull/226 MulticodecKindRSAPubKey = 0x1205 // MulticodecKindEd25519PubKey ed25519-pub MulticodecKindEd25519PubKey = 0xed // MulticodecKindSecp256k1PubKey secp256k1-pub MulticodecKindSecp256k1PubKey = 0xe7 )
Variables ¶
This section is empty.
Functions ¶
func GetMulticodecType ¶
GetMulticodecType returns the multicodec type for a given crypto key type. This is useful for external validation and encoding operations.
func ValidateFormat ¶
ValidateFormat validates that the DID string conforms to proper did:key format. This ensures the DID follows the W3C DID specification with proper multicodec encoding.
Types ¶
type DID ¶
DID is a DID:key identifier
func NewFromMPCPubKey ¶
NewFromMPCPubKey creates a DID from MPC enclave public key bytes. This is specifically designed for MPC enclave integration where public key bytes are provided directly from the enclave without additional encoding.
func NewFromPubKey ¶
NewFromPubKey constructs an Identifier from a public key
func (DID) Address ¶
Address derives a blockchain-compatible address from the DID. This provides a consistent address format for use across different blockchain contexts.
func (DID) CompressedPubKey ¶
CompressedPubKey returns the compressed public key bytes for Secp256k1 keys. For other key types, returns the raw public key bytes.
func (DID) MulticodecType ¶
MulticodecType indicates the type for this multicodec