Closeable
, AutoCloseable
, Readable
public class PEMReader extends PEMReader
PasswordCache
.Constructor | Description |
---|---|
PEMReader(File in) |
Create PEMReader for a File
|
PEMReader(File in,
String msg) |
Create PEMReader for an encrypted File
|
Modifier and Type | Method | Description |
---|---|---|
Object |
readObject() |
|
static Object |
readObject(File in) |
Return single object from PEM file.
|
static Object |
readObject(File in,
Class<?> type) |
Return single object from PEM file.
|
static Object |
readObject(File in,
Class<?> type,
String msg) |
Return single object from encrypted PEM file.
|
static Object |
readObject(File in,
String msg) |
Return single object from encrypted PEM file.
|
close, lines, mark, markSupported, read, read, readLine, ready, reset, skip
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
readPemObject
read, read, transferTo
public PEMReader(File in) throws FileNotFoundException
FileNotFoundException
public PEMReader(File in, String msg) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public static Object readObject(File in) throws FileNotFoundException, IOException
The first object will be returned, others are discarded.
FileNotFoundException
IOException
public Object readObject() throws IOException
This method also invalidates the password when an IOException occurs
and throws a PasswordCancelledException
when the user cancelled the
password entry.
This method accepts garbage before and after any PEM blocks (outside of BEGIN/END). BouncyCastle 1.46 does not accept this (earlier versions do).
Currently uses BufferedReader.mark(int)
and BufferedReader.reset()
, so these cannot be used by
calling code, sorry.
readObject
in class PEMReader
IOException
public static Object readObject(File in, Class<?> type) throws FileNotFoundException, IOException
This version accepts a type as argument. The first object that matches the type is returned, others are discarded.
FileNotFoundException
IOException
public static Object readObject(File in, String msg) throws FileNotFoundException, IOException
The first object will be returned, others are discarded.
FileNotFoundException
IOException
public static Object readObject(File in, Class<?> type, String msg) throws FileNotFoundException, IOException
This version accepts a type as argument. The first object that matches the type is returned, others are discarded.
FileNotFoundException
IOException
Copyright © 2010-2018 Nikhef / Stichting FOM. All Rights Reserved.