com.netscape.certsrv.security
Interface ISigningUnit


public interface ISigningUnit

A class represents the signing unit which is capable of signing data.

Version:
$Revision: 1310 $, $Date: 2010-09-20 17:28:48 -0700 (Mon, 20 Sep 2010) $

Field Summary
static java.lang.String PROP_CERT_NICKNAME
           
static java.lang.String PROP_DEFAULT_SIGNALG
           
static java.lang.String PROP_NEW_NICKNAME
           
static java.lang.String PROP_RENAMED_CERT_NICKNAME
           
static java.lang.String PROP_TOKEN_NAME
           
 
Method Summary
 org.mozilla.jss.crypto.SignatureAlgorithm checkSigningAlgorithmFromName(java.lang.String algname)
          Checks if the given algorithm name is supported.
 java.lang.String[] getAllAlgorithms()
          Retrieves all supported signing algorithm of this unit.
 org.mozilla.jss.crypto.X509Certificate getCert()
          Retrieves the signing certificate.
 netscape.security.x509.X509CertImpl getCertImpl()
          Retrieves the signing certificate.
 java.lang.String getDefaultAlgorithm()
          Retrieves the default algorithm name.
 org.mozilla.jss.crypto.SignatureAlgorithm getDefaultSignatureAlgorithm()
          Retrieves the default algorithm.
 java.lang.String getNewNickName()
          Retrieves the new nickname in the renewal process.
 java.lang.String getNickname()
          Retrieves the nickname of the signing certificate.
 java.security.PublicKey getPublicKey()
          Retrieves the public key associated in this unit.
 java.lang.String getTokenName()
          Retrieves the token name of this unit.
 void setDefaultAlgorithm(java.lang.String algorithm)
          Set default signing algorithm.
 void setNewNickName(java.lang.String name)
          Sets new nickname of the signing certificate.
 byte[] sign(byte[] data, java.lang.String algname)
          Signs the given data in specific algorithm.
 void updateConfig(java.lang.String nickname, java.lang.String tokenname)
          Updates new nickname and tokename in the configuration file.
 boolean verify(byte[] data, byte[] signature, java.lang.String algname)
          Verifies the signed data.
 

Field Detail

PROP_DEFAULT_SIGNALG

static final java.lang.String PROP_DEFAULT_SIGNALG
See Also:
Constant Field Values

PROP_CERT_NICKNAME

static final java.lang.String PROP_CERT_NICKNAME
See Also:
Constant Field Values

PROP_RENAMED_CERT_NICKNAME

static final java.lang.String PROP_RENAMED_CERT_NICKNAME
See Also:
Constant Field Values

PROP_TOKEN_NAME

static final java.lang.String PROP_TOKEN_NAME
See Also:
Constant Field Values

PROP_NEW_NICKNAME

static final java.lang.String PROP_NEW_NICKNAME
See Also:
Constant Field Values
Method Detail

getNickname

java.lang.String getNickname()
Retrieves the nickname of the signing certificate.


getNewNickName

java.lang.String getNewNickName()
                                throws EBaseException
Retrieves the new nickname in the renewal process.

Returns:
new nickname
Throws:
EBaseException - failed to get new nickname

setNewNickName

void setNewNickName(java.lang.String name)
Sets new nickname of the signing certificate.

Parameters:
name - nickname

getCert

org.mozilla.jss.crypto.X509Certificate getCert()
Retrieves the signing certificate.

Returns:
signing certificate

getCertImpl

netscape.security.x509.X509CertImpl getCertImpl()
Retrieves the signing certificate.

Returns:
signing certificate

sign

byte[] sign(byte[] data,
            java.lang.String algname)
            throws EBaseException
Signs the given data in specific algorithm.

Parameters:
data - data to be signed
algname - signing algorithm to be used
Returns:
signed data
Throws:
EBaseException - failed to sign

verify

boolean verify(byte[] data,
               byte[] signature,
               java.lang.String algname)
               throws EBaseException
Verifies the signed data.

Parameters:
data - signed data
signature - signature
algname - signing algorithm
Returns:
true if verification is good
Throws:
EBaseException - failed to verify

getDefaultSignatureAlgorithm

org.mozilla.jss.crypto.SignatureAlgorithm getDefaultSignatureAlgorithm()
Retrieves the default algorithm.

Returns:
default signing algorithm

getDefaultAlgorithm

java.lang.String getDefaultAlgorithm()
Retrieves the default algorithm name.

Returns:
default signing algorithm name

setDefaultAlgorithm

void setDefaultAlgorithm(java.lang.String algorithm)
                         throws EBaseException
Set default signing algorithm.

Parameters:
algorithm - signing algorithm
Throws:
EBaseException - failed to set default signing algorithm

getAllAlgorithms

java.lang.String[] getAllAlgorithms()
                                    throws EBaseException
Retrieves all supported signing algorithm of this unit.

Returns:
a list of signing algorithms
Throws:
EBaseException - failed to list

getTokenName

java.lang.String getTokenName()
                              throws EBaseException
Retrieves the token name of this unit.

Returns:
token name
Throws:
EBaseException - failed to retrieve name

updateConfig

void updateConfig(java.lang.String nickname,
                  java.lang.String tokenname)
Updates new nickname and tokename in the configuration file.

Parameters:
nickname - new nickname
tokenname - new tokenname

checkSigningAlgorithmFromName

org.mozilla.jss.crypto.SignatureAlgorithm checkSigningAlgorithmFromName(java.lang.String algname)
                                                                        throws EBaseException
Checks if the given algorithm name is supported.

Parameters:
algname - algorithm name
Returns:
signing algorithm
Throws:
EBaseException - failed to check signing algorithm

getPublicKey

java.security.PublicKey getPublicKey()
Retrieves the public key associated in this unit.

Returns:
public key