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 . |
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() |
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 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 RSAPrivateCrtKeySpec getRSAPrivateKeySpec()
RSAPrivateCrtKeySpec
.RSAPrivateCrtKeySpec
.public RSAPublicKeySpec getRSAPublicKeySpec()
RSAPrivateCrtKeySpec
.RSAPrivateCrtKeySpec
.Copyright © 2016–2020 Pivotal Software, Inc.. All rights reserved.