Class PKCS8DERReader
- java.lang.Object
-
- java.io.Reader
-
- java.io.BufferedReader
-
- org.bouncycastle.util.io.pem.PemReader
-
- org.bouncycastle.openssl.PEMParser
-
- eu.emi.security.authn.x509.helpers.PKCS8DERReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Readable
public class PKCS8DERReader extends org.bouncycastle.openssl.PEMParserThis class extends thePEMParserclass from the BC library. It is modified to read DER input, not the PEM (it can be considered a smart-hack) as otherwise BC's parsers code would need to be copied. It supports reading of the PKCS8 private key in DER form. It is assumed that the key is encrypted if a password is provided.This class interface is the readObject method.
This implementation overrides the
PemReaderreadPemObject method to actually read the DER. The Reader used by thePemReaderis not used.- Author:
- K. Benedyczak
-
-
Constructor Summary
Constructors Constructor Description PKCS8DERReader(java.io.InputStream is, boolean encrypted)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.bouncycastle.util.io.pem.PemObjectreadPemObject()Generate BC's PemObject from the input stream.
-
-
-
Method Detail
-
readPemObject
public org.bouncycastle.util.io.pem.PemObject readPemObject() throws java.io.IOExceptionGenerate BC's PemObject from the input stream. The object's type is fixed to encrypted or plain private key.- Overrides:
readPemObjectin classorg.bouncycastle.util.io.pem.PemReader- Returns:
- the parsed PEM object
- Throws:
java.io.IOException- IO exception
-
-