eu.emi.security.authn.x509.helpers
Class CachedPEMReader

java.lang.Object
  extended by java.io.Reader
      extended by java.io.BufferedReader
          extended by org.bouncycastle.util.io.pem.PemReader
              extended by org.bouncycastle.openssl.PEMReader
                  extended by eu.emi.security.authn.x509.helpers.CachedPEMReader
All Implemented Interfaces:
Closeable, Readable

public class CachedPEMReader
extends PEMReader

This class extends the PEMReader class from the BC library. It is modified to use the provided PemObject (it is done to optimize the code: pem is not read twice) as otherwise BC's parsers code would need to be copied. The reader is bootstraped with the data from the PemObject.

This class interface is the readObject method.

This implementation overrides the PemReader readPemObject method to return a provided PemObject. The Reader used by the PemReader is not used.

Author:
K. Benedyczak

Field Summary
protected  PasswordFinder myPFinder
           
protected  PemObject pem
           
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
CachedPEMReader(PemObject pem)
           
CachedPEMReader(PemObject pem, PasswordFinder pFinder)
           
 
Method Summary
 PemObject readPemObject()
          Generate BC's PemObject from the input stream.
 
Methods inherited from class org.bouncycastle.openssl.PEMReader
readObject
 
Methods inherited from class java.io.BufferedReader
close, mark, markSupported, read, read, readLine, ready, reset, skip
 
Methods inherited from class java.io.Reader
read, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pem

protected PemObject pem

myPFinder

protected PasswordFinder myPFinder
Constructor Detail

CachedPEMReader

public CachedPEMReader(PemObject pem,
                       PasswordFinder pFinder)

CachedPEMReader

public CachedPEMReader(PemObject pem)
Method Detail

readPemObject

public PemObject readPemObject()
                        throws IOException
Generate BC's PemObject from the input stream.

Overrides:
readPemObject in class PemReader
Returns:
the parsed PEM object
Throws:
IOException


Copyright © 2012-2013 European Middleware Initiative. All Rights Reserved.