|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
net.rim.device.api.crypto.CryptoOutputStream
net.rim.device.api.crypto.SignatureSignerOutputStream
public class SignatureSignerOutputStream
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.
SignatureVerifierInputStream
Field Summary | ||
---|---|---|
|
protected boolean |
_on
Allows the user to determine whether the information being written to the stream should go through the signature signer as well. |
|
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 | ||
---|---|---|
|
SignatureSignerOutputStream(SignatureSigner signer,
OutputStream out)
Creates a SignatureSignerOutputStream object taking as input a signature signer and
an output stream. |
Method Summary | ||
---|---|---|
|
String |
getAlgorithm()
Returns the name of this algorithm. |
|
SignatureSigner |
getSignatureSigner()
Returns a copy of the signature signer class in use. |
|
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. |
|
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 |
---|
protected SignatureSigner _signer
protected boolean _on
By default, _on is set to true.
Constructor Detail |
---|
public SignatureSignerOutputStream(SignatureSigner signer, OutputStream out)
SignatureSignerOutputStream
object taking as input a signature signer and
an output stream.
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.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 CryptoOutputStream
public void on(boolean on)
on
- If true, the information will be passed to the signature
signer. If false, it will not be passed to the signer.public void write(byte[] buffer, int offset, int length) throws IOException
CryptoOutputStream
write
in class CryptoOutputStream
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.
IOException
- Thrown if an I/O error occurs.public SignatureSigner getSignatureSigner()
SignatureSigner
in use.
|
|||||||||
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