com.rsa.swsj
Class X509Data

java.lang.Object
  extended bycom.rsa.swsj.X509Data
All Implemented Interfaces:
KeyInfo

public final class X509Data
extends java.lang.Object
implements KeyInfo

This class stores one or more identifiers of X.509 certificates such as subject name, or issuer name and serial number, that can be used for validation and encryption. These identifiers map to the same certificate. There are five types of X509Data, namely: X509IssuerSerial, X509SubjectName, X509SKI, X509Certificate, and X509CRL.

Note:X509SKI is not supported by Secure-WS-J.

This class is also used to find an appropriate transport key for decryption.


Constructor Summary
X509Data(SWSJContext context)

Creates an empty X509Data object initialized only with context.

 
Method Summary

 void

addCertificate(java.security.cert.X509Certificate certificate)

Adds an X509Certificate object to include in this X509Data object.

 void

addX509CRL(java.security.cert.X509CRL crl)

Adds an X509CRL object to include in this X509Data object.

 java.security.cert.X509Certificate[]

getCertificateChain()

Returns the certificate chain stored in this X509Data object.

 SWSJContext

getContext()

Gets the SWSJContext.

 java.lang.String

getIssuerName()

Returns the issuer distinguished name of this X509Data object, if there is one.

 byte[]

getIssuerSerialNumber()

Returns the issuer serial number of this X509Data object, if there is one.

 java.lang.String

getSubjectName()

Returns the subject distinguished name of this X509Data object, if there is one.

 java.security.cert.X509CRL[]

getX509CRLs()

Returns the X509CRL objects stored in this X509Data object.

 void

setCertificateChain(java.security.cert.X509Certificate[] certificates)

Sets the certificate chain to include in this X509Data object.

 void

setIssuerName(java.lang.String issuerName)

Sets the issuer's distinguished name for this X509Data.

 void

setIssuerSerialNumber(byte[] serialNum)

Sets the issuer serial number to this X509Data object.

 void

setSubjectName(java.lang.String subjectName)

Sets the subject distinguished name to this X509Data object.

 void

setX509CRLs(java.security.cert.X509CRL[] crls)

Sets the list of X509CRL objects to include in this X509Data object.

 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

X509Data

public X509Data(SWSJContext context)
         throws InvalidParameterException
Creates an empty X509Data object initialized only with context.

Parameters:
context - An object that collects a number of common parameters and state variables; for example, JCE provider.
Throws:
InvalidParameterException - If context is invalid.
Method Detail

getContext

public SWSJContext getContext()
Gets the SWSJContext.

Specified by:
getContext in interface KeyInfo
Returns:
The toolkit context

setSubjectName

public void setSubjectName(java.lang.String subjectName)
                    throws InvalidParameterException
Sets the subject distinguished name to this X509Data object.

Parameters:
subjectName - A String object.
Throws:
InvalidParameterException - If subjectName is null.

getSubjectName

public java.lang.String getSubjectName()
Returns the subject distinguished name of this X509Data object, if there is one.

Returns:
The subject name of this X509Data object as a String.

setIssuerName

public void setIssuerName(java.lang.String issuerName)
                   throws InvalidParameterException
Sets the issuer's distinguished name for this X509Data. If this method is called, setIssuerSerialNumber() must be called, also.

Parameters:
issuerName - An String object that is the issuer name of an X.509 certificate.
Throws:
InvalidParameterException - If issuerName is invalid.
See Also:
setIssuerSerialNumber(byte[])

getIssuerName

public java.lang.String getIssuerName()
Returns the issuer distinguished name of this X509Data object, if there is one.

Returns:
The issuerName of this X509Data object as a String.

setX509CRLs

public void setX509CRLs(java.security.cert.X509CRL[] crls)
                 throws InvalidParameterException
Sets the list of X509CRL objects to include in this X509Data object.

Parameters:
crls - An X509CRL array containing the CRLs to set.
Throws:
InvalidParameterException - If crls is invalid.

getX509CRLs

public java.security.cert.X509CRL[] getX509CRLs()
Returns the X509CRL objects stored in this X509Data object.

Returns:
The CRLs stored in this X509Data object.

addX509CRL

public void addX509CRL(java.security.cert.X509CRL crl)
                throws InvalidParameterException
Adds an X509CRL object to include in this X509Data object.

Parameters:
crl - An X509CRL object to add.
Throws:
InvalidParameterException - If crl is null.

setCertificateChain

public void setCertificateChain(java.security.cert.X509Certificate[] certificates)
                         throws InvalidParameterException
Sets the certificate chain to include in this X509Data object. A user can set the X509Certificate that is required during verification by passing an array that contains only that certificate.

Note: For decryption, use the transport key in XMLEncryption, not a certificate chain.

Parameters:
certificates - An X509Certificate array containing the certificate chain to set.
Throws:
InvalidParameterException - If certificates is invalid.

getCertificateChain

public java.security.cert.X509Certificate[] getCertificateChain()
Returns the certificate chain stored in this X509Data object.

Returns:
The certificates stored in this X509Data object.

addCertificate

public void addCertificate(java.security.cert.X509Certificate certificate)
                    throws InvalidParameterException
Adds an X509Certificate object to include in this X509Data object.

Parameters:
certificate - An X509Certificate object to add.
Throws:
InvalidParameterException - If certificate is invalid.

setIssuerSerialNumber

public void setIssuerSerialNumber(byte[] serialNum)
                           throws InvalidParameterException
Sets the issuer serial number to this X509Data object. If this method is called, setIssuerName() must be called, also.

Parameters:
serialNum - The issuer's serial number, as a byte array.
Throws:
InvalidParameterException - If serialNum is invalid.
See Also:
setIssuerName(String)

getIssuerSerialNumber

public byte[] getIssuerSerialNumber()
Returns the issuer serial number of this X509Data object, if there is one.

Returns:
The issuer serial number, as a byte array.