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