|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
net.rim.device.api.crypto.CryptoInputStream
net.rim.device.api.crypto.SignatureVerifierInputStream
public class SignatureVerifierInputStream
Combines the use of a signature verifier with the use of streams. The streams contain the information that needs to be passed through the signature verifier checking for the validity of the signature.
SignatureSignerOutputStream
Field Summary | ||
---|---|---|
|
protected boolean |
_on
Determines whether or not the data that is read into the class through the underlying input stream will go through the signature verifier before being returned to the user. |
|
protected SignatureVerifier |
_verifier
Contains the SignatureVerifier object that is used to
determine if the signature is correct. |
Fields inherited from class net.rim.device.api.crypto.CryptoInputStream |
---|
_inputStream |
Constructor Summary | ||
---|---|---|
|
SignatureVerifierInputStream(SignatureVerifier verifier,
InputStream inputStream)
Establishes the input stream being used for reading data and the signature verifier that is used to determine the validity of the signature. |
Method Summary | ||
---|---|---|
|
String |
getAlgorithm()
Returns the name of this algorithm. |
|
SignatureVerifier |
getSignatureVerifier()
Returns a copy of the signature verifier class in use. |
|
void |
on(boolean on)
Determines whether or not the information read from the stream should be passed through the signature before being written to the output byte arrays. |
|
int |
read(byte[] data,
int offset,
int length)
Reads up to the specified number of bytes from this input stream into an array of bytes. |
Methods inherited from class net.rim.device.api.crypto.CryptoInputStream |
---|
available, close, getInputStream, markSupported, read, read |
Methods inherited from class java.io.InputStream |
---|
mark, reset, skip |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected SignatureVerifier _verifier
SignatureVerifier
object that is used to
determine if the signature is correct.
protected boolean _on
By default, _on is set to true.
Constructor Detail |
---|
public SignatureVerifierInputStream(SignatureVerifier verifier, InputStream inputStream)
verifier
- The signature verifier that provides the mechanism for
determining if the signature is valid or not.inputStream
- The underlying input stream that is used for reading
data from.Method Detail |
---|
public String getAlgorithm()
This method calls the appropriate SignatureVerifier's
getAlgorithm()
method.
For example, DSASignatureSigner
returns
"DSA_" + digest.getAlgorithm()
, ECDASignatureSigner
returns "ECDSA_" + digest.getAlgorithm()
,
PSSSignatureSigner
returns "RSA_PSS_" + digest.getAlgorithm()
,
NullSignatureSigner
returns "Null"
.
getAlgorithm
in class CryptoInputStream
public void on(boolean on)
By default, _on is set to true at start up.
on
- If on is true, the information will be passed to the signature
verifier. If false, it will not be passed to the verifier.public int read(byte[] data, int offset, int length) throws IOException
CryptoInputStream
read
in class CryptoInputStream
data
- The buffer into which the data is read.offset
- The starting offset within the buffer, to store the data.length
- The maximum number of bytes to read.
IOException
- Thrown if an I/O error occurs.InputStream.read()
public SignatureVerifier getSignatureVerifier()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal