PublicKeyInterface
type PublicKeyInterface
Enum of valid public keys for the signature schemes supported by IOTA.
BCS
The BCS serialized form of this type is specified in [`bcs-schema.abnf`](https://github.com/iotaledger/iota-rust-sdk/blob/develop/crates/iota-sdk-types/bcs-schema.abnf\).
The gap in the flag values of the `public-key` rule is intentional, as not all signature schemes support public keys.
There is also a base64 encoding for this type defined as:
```text base64-public-key = string ; which is valid base64 encoded ; and the decoded bytes are defined ; by flagged-public-key flagged-public-key = (ed25519-flag ed25519-public-key) / (secp256k1-flag secp256k1-public-key) / (secp256r1-flag secp256r1-public-key) / (passkey-flag passkey-public-key) ```
type PublicKeyInterface interface {
// Convert this type to BCS encoded bytes.
ToBcs() ([]byte, error)
// Render this type as human-readable text.
//
// Some types also print this through the binding's native string conversion; this
// method is the spelling every object type has.
//
// The layout is meant for reading and can change between releases. Use the JSON or
// BCS conversions for output that gets parsed.
ToDisplayString() string
// Convert this type to a JSON encoded string.
ToJson() (string, error)
AsEd25519() *Ed25519PublicKey
AsOptEd25519() **Ed25519PublicKey
AsOptPasskey() **PasskeyPublicKey
AsOptSecp256k1() **Secp256k1PublicKey
AsOptSecp256r1() **Secp256r1PublicKey
AsPasskey() *PasskeyPublicKey
AsSecp256k1() *Secp256k1PublicKey
AsSecp256r1() *Secp256r1PublicKey
IsEd25519() bool
IsPasskey() bool
IsSecp256k1() bool
IsSecp256r1() bool
Scheme() SignatureScheme
// Encode this public key as a base64 string of its scheme-flagged byte representation
ToBase64() string
}