public class SecureKeys extends SecureKeysWithoutBouncyCastle
Modifier and Type | Class and Description |
---|---|
static class |
SecureKeys.PassphraseProblem |
Modifier and Type | Method and Description |
---|---|
static boolean |
equal(java.security.KeyPair k1,
java.security.KeyPair k2)
because KeyPair.equals is not implemented :(
|
static java.security.PublicKey |
fromPub(java.lang.String pubText)
opposite of
toPub(KeyPair) , given text |
static org.bouncycastle.jce.X509Principal |
getX509PrincipalWithCommonName(java.lang.String commonName)
RFC1773 order, with None for other values.
|
static void |
initBouncyCastleProvider() |
static java.security.KeyPair |
readPem(java.io.InputStream input,
java.lang.String passphrase)
reads RSA or DSA / pem style private key files (viz
toPem(KeyPair) ), extracting also the public key if possible |
static java.lang.String |
stringPem(java.security.KeyPair key)
Deprecated.
since 0.7.0, use
toPem(KeyPair) |
static java.lang.String |
toPem(java.security.KeyPair key)
returns the PEM (base64, ie for id_rsa) string for the private key / key pair;
this starts -----BEGIN PRIVATE KEY----- and ends similarly, like id_rsa.
|
static java.lang.String |
toPub(java.security.KeyPair key)
returns id_rsa.pub style file, of public key
|
getCanonicalImpl, getTrustManager, getTrustManager, getTrustManager, getX500PrincipalWithCommonName, isCertificateAuthorizedBy, newKeyPair, newKeyPair, newKeyPairGenerator, newKeyStore, newKeyStore
public static void initBouncyCastleProvider()
public static org.bouncycastle.jce.X509Principal getX509PrincipalWithCommonName(java.lang.String commonName)
public static java.security.KeyPair readPem(java.io.InputStream input, java.lang.String passphrase)
toPem(KeyPair)
), extracting also the public key if possiblejava.lang.IllegalStateException
- on errors, in particular SecureKeys.PassphraseProblem
if that is the problempublic static boolean equal(java.security.KeyPair k1, java.security.KeyPair k2)
public static java.lang.String toPem(java.security.KeyPair key)
readPem(InputStream, String)
public static java.lang.String toPub(java.security.KeyPair key)
public static java.security.PublicKey fromPub(java.lang.String pubText)
toPub(KeyPair)
, given text@Deprecated public static java.lang.String stringPem(java.security.KeyPair key)
toPem(KeyPair)