public class PemObject extends Object
RSAPrivateCrtKeySpec
.
Mainly for use within the framework.
Modifier and Type | Method and Description |
---|---|
static PemObject |
fromKey(String content)
Create a
PemObject from PEM content that is enclosed with
-BEGIN PRIVATE KEY- and -END PRIVATE KEY- . |
X509Certificate |
getCertificate()
Retrieve a
X509Certificate . |
List<X509Certificate> |
getCertificates()
Retrieve one or more
X509Certificate s. |
RSAPrivateCrtKeySpec |
getRSAKeySpec()
Deprecated.
since 2.3. Use
getRSAPrivateKeySpec() instead that uses an
improved name to indicate what the method is supposed to return. |
RSAPrivateCrtKeySpec |
getRSAPrivateKeySpec()
Retrieve a
RSAPrivateCrtKeySpec . |
RSAPublicKeySpec |
getRSAPublicKeySpec()
Retrieve a
RSAPrivateCrtKeySpec . |
boolean |
isCertificate() |
static boolean |
isPemEncoded(String content)
Check whether the content is PEM-encoded.
|
boolean |
isPrivateKey() |
boolean |
isPublicKey() |
static List<PemObject> |
parse(String content)
Create one or more
PemObject s from PEM content . |
static PemObject |
parseFirst(String content)
Create a
PemObject from PEM content that is enclosed with
-BEGIN PRIVATE KEY- or -BEGIN PUBLIC KEY- . |
public static boolean isPemEncoded(String content)
content
- the content to inspecttrue
if PEM-encoded.public static PemObject fromKey(String content)
PemObject
from PEM content
that is enclosed with
-BEGIN PRIVATE KEY-
and -END PRIVATE KEY-
. This method returns
either the first PEM object ot throws IllegalArgumentException
of no object
could be found.content
- the PEM content.PemObject
from PEM content
.IllegalArgumentException
- if no PEM object could be found.public static PemObject parseFirst(String content)
PemObject
from PEM content
that is enclosed with
-BEGIN PRIVATE KEY-
or -BEGIN PUBLIC KEY-
. This method returns
either the first PEM object ot throws IllegalArgumentException
of no object
could be found.content
- the PEM content.PemObject
from PEM content
.IllegalArgumentException
- if no PEM object could be found.public static List<PemObject> parse(String content)
PemObject
s from PEM content
. Accepts
concatenated PEM objects.content
- the PEM content.PemObject
from PEM content
.public boolean isCertificate()
public boolean isPrivateKey()
public boolean isPublicKey()
@Deprecated public RSAPrivateCrtKeySpec getRSAKeySpec()
getRSAPrivateKeySpec()
instead that uses an
improved name to indicate what the method is supposed to return.RSAPrivateCrtKeySpec
.RSAPrivateCrtKeySpec
.public X509Certificate getCertificate()
X509Certificate
.X509Certificate
.public List<X509Certificate> getCertificates()
X509Certificate
s.X509Certificate
s.public RSAPrivateCrtKeySpec getRSAPrivateKeySpec()
RSAPrivateCrtKeySpec
.RSAPrivateCrtKeySpec
.public RSAPublicKeySpec getRSAPublicKeySpec()
RSAPrivateCrtKeySpec
.RSAPrivateCrtKeySpec
.Copyright © 2016–2022 Pivotal Software, Inc.. All rights reserved.