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
Converts a private key string to PrivateKey
PublicKey.fromString(<publicKey>)
String
Converts a public key string to PublicKey
PrivateKey.fromBytes(<privateKey>)
byte []
Converts a private key from bytes to PrivateKey
PublicKey.fromBytes(<publicKey>)
byte [ ]
Converts a public key from bytes to PublicKey
PrivateKey.fromKeystore(<bytes, passphrase>)
byte [ ], String
Private key from keystore and passphrase
PrivateKey.fromPem(<pemEncoded>)
String
Private key from pem encoded String
PrivateKey.fromPem(<pem, passphrase>)
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.
Last updated