public class PKCS8PEMResourceKeyPairParser extends AbstractPEMResourceKeyPairParser
| Modifier and Type | Field and Description |
|---|---|
static String |
BEGIN_MARKER |
static List<String> |
BEGINNERS |
static String |
END_MARKER |
static List<String> |
ENDERS |
static PKCS8PEMResourceKeyPairParser |
INSTANCE |
static String |
PKCS8_FORMAT |
logEMPTY| Constructor and Description |
|---|
PKCS8PEMResourceKeyPairParser() |
| Modifier and Type | Method and Description |
|---|---|
static PrivateKey |
decodePEMPrivateKeyPKCS8(List<Integer> oidAlgorithm,
byte[] keyBytes,
FilePasswordProvider passwordProvider) |
static PrivateKey |
decodePEMPrivateKeyPKCS8(String oid,
byte[] keyBytes,
FilePasswordProvider passwordProvider) |
Collection<KeyPair> |
extractKeyPairs(String resourceKey,
String beginMarker,
String endMarker,
FilePasswordProvider passwordProvider,
InputStream stream) |
static List<Integer> |
getPKCS8AlgorithmIdentifier(ASN1Object privateKeyInfo) |
static List<Integer> |
getPKCS8AlgorithmIdentifier(DERParser parser)
According to the standard:
PrivateKeyInfo ::= SEQUENCE {
version Version,
privateKeyAlgorithm PrivateKeyAlgorithmIdentifier,
privateKey PrivateKey,
attributes [0] IMPLICIT Attributes OPTIONAL
}
Version ::= INTEGER
PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier
PrivateKey ::= OCTET STRING
Attributes ::= SET OF Attribute
AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER,
parameters ANY DEFINED BY algorithm OPTIONAL
}
|
static List<Integer> |
getPKCS8AlgorithmIdentifier(InputStream input,
boolean okToClose) |
applyPrivateKeyCipher, extractKeyPairs, getAlgorithm, getAlgorithmIdentifiercanExtractKeyPairs, extractKeyPairs, getBeginners, getEnders, getEndingMarkers, loadKeyPairsgetSimplifiedLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaggregate, aggregate, canExtractKeyPairs, containsMarkerLine, containsMarkerLine, extractDataBytes, findMarkerLine, findMarkerLine, joinDataLinesloadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairs, loadKeyPairspublic static final String BEGIN_MARKER
public static final String END_MARKER
public static final String PKCS8_FORMAT
public static final PKCS8PEMResourceKeyPairParser INSTANCE
public Collection<KeyPair> extractKeyPairs(String resourceKey, String beginMarker, String endMarker, FilePasswordProvider passwordProvider, InputStream stream) throws IOException, GeneralSecurityException
extractKeyPairs in class AbstractKeyPairResourceParserresourceKey - A hint as to the origin of the text linesbeginMarker - The line containing the begin markerendMarker - The line containing the end markerpasswordProvider - The FilePasswordProvider to use
in case the data is encrypted - may be null if no encryptedstream - The decoded data InputStreamKeyPairs - may be null/empty if none.IOException - If failed to parse the dataGeneralSecurityException - If failed to generate the keyspublic static PrivateKey decodePEMPrivateKeyPKCS8(List<Integer> oidAlgorithm, byte[] keyBytes, FilePasswordProvider passwordProvider) throws GeneralSecurityException
GeneralSecurityExceptionpublic static final PrivateKey decodePEMPrivateKeyPKCS8(String oid, byte[] keyBytes, FilePasswordProvider passwordProvider) throws GeneralSecurityException
GeneralSecurityExceptionpublic static List<Integer> getPKCS8AlgorithmIdentifier(InputStream input, boolean okToClose) throws IOException
IOExceptionpublic static List<Integer> getPKCS8AlgorithmIdentifier(DERParser parser) throws IOException
PrivateKeyInfo ::= SEQUENCE {
version Version,
privateKeyAlgorithm PrivateKeyAlgorithmIdentifier,
privateKey PrivateKey,
attributes [0] IMPLICIT Attributes OPTIONAL
}
Version ::= INTEGER
PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier
PrivateKey ::= OCTET STRING
Attributes ::= SET OF Attribute
AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER,
parameters ANY DEFINED BY algorithm OPTIONAL
}
parser - The DERParser to useIOException - If malformed datagetPKCS8AlgorithmIdentifier(ASN1Object)public static List<Integer> getPKCS8AlgorithmIdentifier(ASN1Object privateKeyInfo) throws IOException
IOExceptionCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.