Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.javax.net.ssl.provider
Class SSLRSASignature  view SSLRSASignature download SSLRSASignature.java

java.lang.Object
  extended bygnu.javax.net.ssl.provider.SSLRSASignature
All Implemented Interfaces:
java.lang.Cloneable, gnu.java.security.sig.ISignature

final class SSLRSASignature
extends java.lang.Object
implements gnu.java.security.sig.ISignature

The RSA signature algorithm as used in the SSL protocol. Note that this is different from the RSA signature used to verify certificates.

This signature scheme works as follows:

digitally-signed struct {
     opaque md5_hash[16];
     opaque sha_hash[20];
 }

Where a digitally-signed struct is RSA-encrypted with block type 0 or 1 according to PKCS #1, version 1.5.


Field Summary
private  boolean initSign
           
private  boolean initVerify
           
private  gnu.java.security.hash.IMessageDigest md5
           
private  java.security.interfaces.RSAPrivateKey privkey
           
private  java.security.interfaces.RSAPublicKey pubkey
           
private  gnu.java.security.hash.IMessageDigest sha
           
 
Fields inherited from interface gnu.java.security.sig.ISignature
SIGNER_KEY, SOURCE_OF_RANDOMNESS, VERIFIER_KEY
 
Constructor Summary
(package private) SSLRSASignature()
           
(package private) SSLRSASignature(gnu.java.security.hash.IMessageDigest md5, gnu.java.security.hash.IMessageDigest sha)
           
 
Method Summary
 java.lang.Object clone()
          Returns a clone copy of this instance.
 java.lang.String name()
          Returns the canonical name of this signature scheme.
 void setupSign(java.util.Map attrib)
          Initialises this instance for signature generation.
 void setupVerify(java.util.Map attrib)
          Initialises this instance for signature verification.
 java.lang.Object sign()
          Terminates a signature generation phase by digesting and processing the context of the underlying message digest algorithm instance.
 void update(byte b)
          Digests one byte of a message for signing or verification purposes.
 void update(byte[] buf, int off, int len)
          Digests a sequence of bytes from a message for signing or verification purposes.
 boolean verify(java.lang.Object signature)
          Terminates a signature verification phase by digesting and processing the context of the underlying message digest algorithm instance.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pubkey

private java.security.interfaces.RSAPublicKey pubkey

privkey

private java.security.interfaces.RSAPrivateKey privkey

md5

private final gnu.java.security.hash.IMessageDigest md5

sha

private final gnu.java.security.hash.IMessageDigest sha

initVerify

private boolean initVerify

initSign

private boolean initSign
Constructor Detail

SSLRSASignature

SSLRSASignature()

SSLRSASignature

SSLRSASignature(gnu.java.security.hash.IMessageDigest md5,
                gnu.java.security.hash.IMessageDigest sha)
Method Detail

name

public java.lang.String name()
Description copied from interface: gnu.java.security.sig.ISignature

Returns the canonical name of this signature scheme.

Specified by:
name in interface gnu.java.security.sig.ISignature

setupVerify

public void setupVerify(java.util.Map attrib)
Description copied from interface: gnu.java.security.sig.ISignature

Initialises this instance for signature verification.

Specified by:
setupVerify in interface gnu.java.security.sig.ISignature

setupSign

public void setupSign(java.util.Map attrib)
Description copied from interface: gnu.java.security.sig.ISignature

Initialises this instance for signature generation.

Specified by:
setupSign in interface gnu.java.security.sig.ISignature

update

public void update(byte b)
Description copied from interface: gnu.java.security.sig.ISignature

Digests one byte of a message for signing or verification purposes.

Specified by:
update in interface gnu.java.security.sig.ISignature

update

public void update(byte[] buf,
                   int off,
                   int len)
Description copied from interface: gnu.java.security.sig.ISignature

Digests a sequence of bytes from a message for signing or verification purposes.

Specified by:
update in interface gnu.java.security.sig.ISignature

sign

public java.lang.Object sign()
Description copied from interface: gnu.java.security.sig.ISignature

Terminates a signature generation phase by digesting and processing the context of the underlying message digest algorithm instance.

Specified by:
sign in interface gnu.java.security.sig.ISignature

verify

public boolean verify(java.lang.Object signature)
Description copied from interface: gnu.java.security.sig.ISignature

Terminates a signature verification phase by digesting and processing the context of the underlying message digest algorithm instance.

Specified by:
verify in interface gnu.java.security.sig.ISignature

clone

public java.lang.Object clone()
Description copied from interface: gnu.java.security.sig.ISignature

Returns a clone copy of this instance.

Specified by:
clone in interface gnu.java.security.sig.ISignature