net.rim.device.api.crypto
Class SignatureSignerOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by net.rim.device.api.crypto.CryptoOutputStream
          extended by net.rim.device.api.crypto.SignatureSignerOutputStream

public class SignatureSignerOutputStream
extends CryptoOutputStream

Allows the user to create an output stream to write all of their data to and also have that data run through a signature signer class to sign the data. The write command will pass data into the signatureSigner's update() method when the on boolean value is true; otherwise it will simply write the data to the stream.

See Also:
SignatureVerifierInputStream
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:
BlackBerry API 3.6.0

Field Summary
Category: Signed protected  boolean _on
          Allows the user to determine whether the information being written to the stream should go through the signature signer as well.
Category: Signed protected  SignatureSigner _signer
          Contains the signature signer class that is being used for this instance.
 
Fields inherited from class net.rim.device.api.crypto.CryptoOutputStream
_out
 
Constructor Summary
Category: Signed SignatureSignerOutputStream(SignatureSigner signer, OutputStream out)
          Creates a SignatureSignerOutputStream object taking as input a signature signer and an output stream.
 
Method Summary
Category: Signed  String getAlgorithm()
          Returns the name of this algorithm.
Category: Signed  SignatureSigner getSignatureSigner()
          Returns a copy of the signature signer class in use.
Category: Signed  void on(boolean on)
          Determines whether or not the information written to the write method should be passed through the signature before being written to the output stream.
Category: Signed  void write(byte[] buffer, int offset, int length)
          Writes a specified length of bytes from the given byte array to this output stream.
 
Methods inherited from class net.rim.device.api.crypto.CryptoOutputStream
close, flush, getOutputStream, write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

_signer

protected SignatureSigner _signer
Contains the signature signer class that is being used for this instance.

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:
BlackBerry API 3.6.0

_on

protected boolean _on
Allows the user to determine whether the information being written to the stream should go through the signature signer as well.

By default, _on is set to true.

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:
BlackBerry API 3.6.0


Constructor Detail

SignatureSignerOutputStream

public SignatureSignerOutputStream(SignatureSigner signer,
                                   OutputStream out)
Creates a SignatureSignerOutputStream object taking as input a signature signer and an output stream.

Parameters:
signer - A SignatureSigner object that contains the algorithm and digest that are to be used for signing all data.
out - The output stream that all data is written to. This parameter is null if only the signing features are to be used.
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:
BlackBerry API 3.6.0


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

Specified by:
getAlgorithm in class CryptoOutputStream
Returns:
A String that represents 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.
Since:
BlackBerry API 3.6.0

on

public void on(boolean on)
Determines whether or not the information written to the write method should be passed through the signature before being written to the output stream. Note that _on is set to true at initialization of the object.

Parameters:
on - If true, the information will be passed to the signature signer. If false, it will not be passed to the signer.
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:
BlackBerry API 3.6.0

write

public void write(byte[] buffer,
                  int offset,
                  int length)
           throws IOException
Description copied from class: CryptoOutputStream
Writes a specified length of bytes from the given byte array to this output stream.

Specified by:
write in class CryptoOutputStream
Parameters:
buffer - The byte array containing the bytes that are going to be written to the output stream.
offset - The offset in the byte array where the method will start writing from.
length - The number of bytes that will be written to the output stream.

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.
Since:
BlackBerry API 3.6.0

getSignatureSigner

public SignatureSigner getSignatureSigner()
Returns a copy of the signature signer class in use.

Returns:
The SignatureSigner in use.
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:
BlackBerry API 3.6.0





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