Skip to main content

PublicKey

type PublicKey​

Enum of valid public keys for the signature schemes supported by IOTA.

BCS​

The BCS serialized form for this type is defined by the following ABNF:

```text public-key = %d00 ed25519-public-key / %d01 secp256k1-public-key / %d02 secp256r1-public-key / %d04 passkey-public-key ```

The gap in the flag values is intentional, as not all signature scheme 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 PublicKey struct {
// contains filtered or unexported fields
}

func LiftFromExternalPublicKey​

func LiftFromExternalPublicKey(handle uint64) *PublicKey

func PublicKeyFromBase64​

func PublicKeyFromBase64(s string) (*PublicKey, error)

Decode a public key from a base64 string of its scheme-flagged byte representation

func PublicKeyFromBcs​

func PublicKeyFromBcs(bcs []byte) (*PublicKey, error)

Create this type from BCS encoded bytes.

func PublicKeyFromJson​

func PublicKeyFromJson(json string) (*PublicKey, error)

Create this type from JSON encoded string.

func (*PublicKey) AsEd25519​

func (_self *PublicKey) AsEd25519() *Ed25519PublicKey

func (*PublicKey) AsOptEd25519​

func (_self *PublicKey) AsOptEd25519() **Ed25519PublicKey

func (*PublicKey) AsOptPasskey​

func (_self *PublicKey) AsOptPasskey() **PasskeyPublicKey

func (*PublicKey) AsOptSecp256k1​

func (_self *PublicKey) AsOptSecp256k1() **Secp256k1PublicKey

func (*PublicKey) AsOptSecp256r1​

func (_self *PublicKey) AsOptSecp256r1() **Secp256r1PublicKey

func (*PublicKey) AsPasskey​

func (_self *PublicKey) AsPasskey() *PasskeyPublicKey

func (*PublicKey) AsSecp256k1​

func (_self *PublicKey) AsSecp256k1() *Secp256k1PublicKey

func (*PublicKey) AsSecp256r1​

func (_self *PublicKey) AsSecp256r1() *Secp256r1PublicKey

func (*PublicKey) DebugString​

func (_self *PublicKey) DebugString() string

func (*PublicKey) Destroy​

func (object *PublicKey) Destroy()

func (*PublicKey) Eq​

func (_self *PublicKey) Eq(other *PublicKey) bool

func (*PublicKey) IsEd25519​

func (_self *PublicKey) IsEd25519() bool

func (*PublicKey) IsPasskey​

func (_self *PublicKey) IsPasskey() bool

func (*PublicKey) IsSecp256k1​

func (_self *PublicKey) IsSecp256k1() bool

func (*PublicKey) IsSecp256r1​

func (_self *PublicKey) IsSecp256r1() bool

func (*PublicKey) Ne​

func (_self *PublicKey) Ne(other *PublicKey) bool

func (*PublicKey) Scheme​

func (_self *PublicKey) Scheme() SignatureScheme

func (*PublicKey) ToBase64​

func (_self *PublicKey) ToBase64() string

Encode this public key as a base64 string of its scheme-flagged byte representation