PublicKey - OpenDive/AptosKit GitHub Wiki
PublicKey
The ED25519 Public Key
public struct PublicKey: Equatable, KeyProtocol, CustomStringConvertible
Inheritance
CustomStringConvertible, Equatable, KeyProtocol
Initializers
init(data:)
public init(data: Data) throws
Properties
LENGTH
The length of the key in bytes
public static let LENGTH: Int = 32
key
The key itself
public let key: Data
description
public var description: String
Methods
verify(data:signature:)
Verify a digital signature for a given data using Ed25519 algorithm.
public func verify(data: Data, signature: Signature) throws -> Bool
This function verifies a digital signature provided by the Ed25519 algorithm for a given data and public key.
Parameters
- data: The Data object to be verified.
- signature: The Signature object containing the signature to be verified.
Throws
An error of type Ed25519Error.invalidSignature if the signature is invalid or an error occurred during verification.
Returns
A Boolean value indicating whether the signature is valid or not.
deserialize(from:)
public static func deserialize(from deserializer: Deserializer) throws -> PublicKey
serialize(_:)
public func serialize(_ serializer: Serializer) throws
Operators
==
public static func == (lhs: PublicKey, rhs: PublicKey) -> Bool