public class PKCS8Util extends Object
| Constructor and Description |
|---|
PKCS8Util() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
toBytes(KeyPair keypair) |
static X509Certificate[] |
toCertificateList(InputStream is) |
static void |
toFile(KeyPair keypair,
File file) |
static void |
toFile(PrivateKey key,
File file) |
static void |
toFile(PublicKey key,
File file) |
static KeyPair |
toKeyPair(byte[] bytes)
Takes a PEM-encoded non-password-protected PKCS8 key-containing Reader and returns the KeyPair within.
|
static KeyPair |
toKeyPair(File file)
Takes a PEM-encoded non-password-protected PKCS8 key-containing file and returns the KeyPair within.
|
static KeyPair |
toKeyPair(File file,
char[] password)
Takes a PEM-encoded PKCS8 key-containing file and returns the KeyPair within.
|
static KeyPair |
toKeyPair(InputStream is)
Takes a PEM-encoded non-password-protected PKCS8 key-containing InputStream and returns the KeyPair within.
|
static KeyPair |
toKeyPair(InputStream is,
char[] password)
Takes a PEM-encoded PKCS8 key-containing InputStream and returns the KeyPair within.
|
static void |
toStream(KeyPair keypair,
OutputStream os) |
static void |
toWriter(KeyPair keypair,
Writer w) |
public static KeyPair toKeyPair(File file) throws IOException
IOException - if the file is not a valid PKCS8 filepublic static KeyPair toKeyPair(File file, char[] password) throws IOException
IOException - if the file is not a valid PKCS8 filepublic static KeyPair toKeyPair(byte[] bytes) throws IOException
IOException - if the stream is not a valid PKCS8 wrapped keypairpublic static KeyPair toKeyPair(InputStream is) throws IOException
IOException - if the stream is not a valid PKCS8 wrapped keypairpublic static void toWriter(KeyPair keypair, Writer w) throws IOException
IOExceptionpublic static void toFile(KeyPair keypair, File file) throws IOException
IOExceptionpublic static void toFile(PublicKey key, File file) throws IOException
IOExceptionpublic static void toFile(PrivateKey key, File file) throws IOException
IOExceptionpublic static void toStream(KeyPair keypair, OutputStream os) throws IOException
IOExceptionpublic static byte[] toBytes(KeyPair keypair) throws IOException
IOExceptionpublic static KeyPair toKeyPair(InputStream is, char[] password) throws IOException
IOException - if the stream is not a valid PKCS8 wrapped keypairpublic static X509Certificate[] toCertificateList(InputStream is) throws IOException
IOExceptionCopyright © 2015. All rights reserved.