Import an existing key
Construct keys in another format to a key representation or import keys from a file.
Method
Type
Description
PrivateKey.fromString(<privateKey>)
String
Constructs a private key string to PrivateKey
PublicKey.fromString(<publicKey>)
String
Constructs a public key string to PublicKey
PrivateKey.fromStringECDSA(<privateKey>)
String
Constructs an ECDSA key from a private key string
PublicKey.fromStringECDSA(<publicKey>)
String
Constructs an ECDSA public key from a public key string
PrivateKey.fromBytesECDSA(<privateKey>)
byte[ ]
Constructs an ECDSA key from a private key bytes
PublicKey.fromBytesECDSA(<publicKey>)
byte[ ]
Constructs an ECDSA public key from a public key bytes
PrivateKey.fromStringED25519(<privateKey>)
String
Constructs an ED25519 key from a private key string
PublicKey.fromStringED25519(<publicKey>)
String
Constructs an ED25519 public key from a public key string
PrivateKey.fromBytesED25519(<privateKey>)
byte [ ]
Constructs an ED25519 key from a private key bytes
PublicKey.fromBytesED25519(<publiceKey>)
byte [ ]
Constructs an ED25519 public key from a public key bytes
PrivateKey.fromBytes(<privateKey>)
byte [ ]
Constructs a private key from bytes to PrivateKey
PublicKey.fromBytes(<publicKey>)
byte [ ]
Contructs a public key from bytes to PublicKey
PrivateKey.fromPem(<pemEncoded>)
String
Parse a private key from a PEM encoded string
PrivateKey.fromPem(<encodedPem, password>)
String, String
Parse a private key from a PEM encoded string. The private key may be encrypted, e.g. if it was generated by OpenSSL.
PrivateKey.readPem(<pemfile>)
Reader
Parse a private key from a PEM encoded reader
PrivateKey.readPem(<pemFile, password>)
Reader, String
Parse a private key from a PEM encoded stream. The key may be encrypted, e.g. if it was generated by OpenSSL.
Last updated