public class OpenSSHPrivateKeyUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
encodePrivateKey(AsymmetricKeyParameter params)
Encode a cipher parameters into an OpenSSH private key.
|
static AsymmetricKeyParameter |
parsePrivateKeyBlob(byte[] blob)
Parse a private key.
|
public static byte[] encodePrivateKey(AsymmetricKeyParameter params) throws IOException
params - the cipher parameters.IOExceptionpublic static AsymmetricKeyParameter parsePrivateKeyBlob(byte[] blob)
This method accepts the body of the OpenSSH private key. The easiest way to extract the body is to use PemReader, for example:
byte[] blob = new PemReader([reader]).readPemObject().getContent(); CipherParameters params = parsePrivateKeyBlob(blob);
blob - The key.Copyright © 2015–2020 The veraPDF Consortium. All rights reserved.