com.ibm.crypto.hdwrCCA.provider
Class RACFInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.ibm.crypto.hdwrCCA.provider.RACFInputStream
-
- All Implemented Interfaces:
- java.io.Closeable, java.lang.AutoCloseable
public class RACFInputStream extends java.io.InputStreamThe RACFInputStream extends InputStream and is for use by the JceRACFKeyStore to read certificates and private keys from RACF.
-
-
Constructor Summary
Constructors Constructor and Description RACFInputStream(java.lang.String userID, java.lang.String ringid, char[] passwd)Constructs an instance of a RACFInputStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intavailable()Return the number of bytes of data still in the RACFInputStream.voidclose()Close the InputStream.java.lang.ObjectgetEntry(java.util.Hashtable racfs, java.lang.String key, char[] passwd)Retrieve a RACF key with the specified alias.voidmark(int readlimit)booleanmarkSupported()Return whether the InputStream supports the mark method.intread()Read a single byte from the RACFInputStream.intread(byte[] buffer)Read data from the RACFInputStream and store it into a byte array.intread(byte[] buffer, int offset, int count)Read data from the RACFInputStream and store it into a byte array.voidreset()
-
-
-
Constructor Detail
-
RACFInputStream
public RACFInputStream(java.lang.String userID, java.lang.String ringid, char[] passwd) throws java.io.IOExceptionConstructs an instance of a RACFInputStream. A RACFInputStream is used to access certificates and keys from a RACF Key Ring.- Parameters:
userID- a string containing the ID of the user that owns the keyringringid- a string containing the name of the RACF key ringpasswd- a character array containing the password for the keystore- Throws:
java.io.IOException- retrieving keys/certificates from the key ring.
-
-
Method Detail
-
read
public int read(byte[] buffer) throws java.io.IOExceptionRead data from the RACFInputStream and store it into a byte array.- Overrides:
readin classjava.io.InputStream- Parameters:
buffer- a byte array that will contain the data from the RACFInputStream- Throws:
java.io.IOException- reading past the end of the InputStream.
-
read
public int read(byte[] buffer, int offset, int count) throws java.io.IOExceptionRead data from the RACFInputStream and store it into a byte array.- Overrides:
readin classjava.io.InputStream- Parameters:
buffer- a byte array that will contain the data from the RACFInputStream.offset- an integer containing the offset into buffer to start writing data to.count- an integer containing the number of bytes to read from the InputStream.- Throws:
java.io.IOException- reading past the end of the InputStream.
-
read
public int read() throws java.io.IOExceptionRead a single byte from the RACFInputStream.- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException- reading past the end of the InputStream.
-
available
public int available()
Return the number of bytes of data still in the RACFInputStream.- Overrides:
availablein classjava.io.InputStream
-
markSupported
public boolean markSupported()
Return whether the InputStream supports the mark method.- Overrides:
markSupportedin classjava.io.InputStream
-
close
public void close() throws java.io.IOExceptionClose the InputStream.- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfacejava.lang.AutoCloseable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
mark
public void mark(int readlimit)
- Overrides:
markin classjava.io.InputStream
-
reset
public void reset() throws java.io.IOException- Overrides:
resetin classjava.io.InputStream- Throws:
java.io.IOException
-
getEntry
public java.lang.Object getEntry(java.util.Hashtable racfs, java.lang.String key, char[] passwd) throws java.io.IOExceptionRetrieve a RACF key with the specified alias.- Parameters:
racfs- hash table containing RACF keyskey- alias of the RACF key to getpasswd- password protecting the RACF key- Returns:
- the constructed
HWKeyEntryRACFobject - Throws:
java.io.IOException- if an error is detected
-
-