SHOW Signed
 

net.rim.device.api.crypto
Class SignatureVerifierInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--net.rim.device.api.crypto.CryptoInputStream
              |
              +--net.rim.device.api.crypto.SignatureVerifierInputStream

public class SignatureVerifierInputStream
extends CryptoInputStream

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.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

Since:
JDE 3.6.0
See Also:
SignatureSignerOutputStream

Field Summary
 Category: Signed 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.
 Category: Signed 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
 Category: Signed 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
 Category: Signed  String getAlgorithm()
          Returns the name of this algorithm.
 Category: Signed  SignatureVerifier getSignatureVerifier()
          Returns a copy of the signature verifier class in use.
 Category: Signed  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.
 Category: Signed  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

_on

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. If true, then the information is passed through the verifier. Otherwise, it is not.

By default, _on is set to true.

Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

_verifier

protected SignatureVerifier _verifier
Contains the SignatureVerifier object that is used to determine if the signature is correct.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Constructor Detail

SignatureVerifierInputStream

public 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.

Parameters:
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Method Detail

getAlgorithm

public String getAlgorithm()
Returns the name of this algorithm.

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".

Overrides:
getAlgorithm in class CryptoInputStream
Since:
JDE 3.6.0

Following copied from class: CryptoInputStream
Returns:
A String representing the name of the algorithm.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getSignatureVerifier

public SignatureVerifier getSignatureVerifier()
Returns a copy of the signature verifier class in use.

Returns:
A copy of the signature verifier.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

on

public 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.

By default, _on is set to true at start up.

Parameters:
on - If on is true, the information will be passed to the signature verifier. If false, it will not be passed to the verifier.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

read

public int read(byte[] data,
                int offset,
                int length)
         throws IOException
Description copied from class: CryptoInputStream
Reads up to the specified number of bytes from this input stream into an array of bytes. This method blocks until some input is available.

Overrides:
read in class CryptoInputStream
Since:
JDE 3.6.0

Following copied from class: CryptoInputStream
Parameters:
buffer - 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.
Returns:
The total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.
Throws:
IOException - Thrown if an I/O error occurs.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.