SimpleKeypair
SimpleKeypair
class SimpleKeypair
debugDescription
var debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the String(reflecting:)
initializer. This initializer works with any type, and uses the custom
debugDescription property for types that conform to
CustomDebugStringConvertible:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of p to a string in the assignment to s uses the
Point type's debugDescription property.
publicKey()
func publicKey() -> PublicKey
scheme()
func scheme() -> SignatureScheme
signPersonalMessage(message:)
func signPersonalMessage(message: PersonalMessage) throws -> UserSignature
Sign a personal message and return a UserSignature.
signTransaction(transaction:)
func signTransaction(transaction: Transaction) throws -> UserSignature
Sign a transaction and return a UserSignature.
toBech32()
func toBech32() throws -> String
Encode a SimpleKeypair as flag || privkey in Bech32 starting with
"iotaprivkey" to a string. Note that the pubkey is not encoded.
toBytes()
func toBytes() -> Data
Encode a SimpleKeypair as flag || privkey in bytes
toDer()
func toDer() throws -> Data
Serialize this private key as DER-encoded PKCS#8
toPem()
func toPem() throws -> String
Serialize this private key as DER-encoded PKCS#8
trySign(message:)
func trySign(message: Data) throws -> SimpleSignature
trySignUser(message:)
func trySignUser(message: Data) throws -> UserSignature
verifyingKey()
func verifyingKey() -> SimpleVerifyingKey
fromBech32(value:)
static func fromBech32(value: String) throws -> SimpleKeypair
Decode a SimpleKeypair from flag || privkey in Bech32 starting with
"iotaprivkey" to SimpleKeypair. The public key is computed directly from
the private key bytes.
fromBytes(bytes:)
static func fromBytes(bytes: Data) throws -> SimpleKeypair
Decode a SimpleKeypair from flag || privkey bytes
fromDer(bytes:)
static func fromDer(bytes: Data) throws -> SimpleKeypair
Deserialize PKCS#8 private key from ASN.1 DER-encoded data (binary format).
fromEd25519(keypair:)
static func fromEd25519(keypair: Ed25519PrivateKey) -> SimpleKeypair
fromPem(s:)
static func fromPem(s: String) throws -> SimpleKeypair
Deserialize PKCS#8-encoded private key from PEM.
fromSecp256k1(keypair:)
static func fromSecp256k1(keypair: Secp256k1PrivateKey) -> SimpleKeypair
fromSecp256r1(keypair:)
static func fromSecp256r1(keypair: Secp256r1PrivateKey) -> SimpleKeypair