org.opensaml.xml.security.x509
Class X509KeyInfoGeneratorFactory.X509KeyInfoGenerator

java.lang.Object
  extended by org.opensaml.xml.security.credential.BasicKeyInfoGeneratorFactory.BasicKeyInfoGenerator
      extended by org.opensaml.xml.security.x509.X509KeyInfoGeneratorFactory.X509KeyInfoGenerator
All Implemented Interfaces:
KeyInfoGenerator
Enclosing class:
X509KeyInfoGeneratorFactory

public class X509KeyInfoGeneratorFactory.X509KeyInfoGenerator
extends BasicKeyInfoGeneratorFactory.BasicKeyInfoGenerator

An implementation of KeyInfoGenerator capable of handling the information contained within a X509Credential.


Field Summary
private  KeyInfoBuilder keyInfoBuilder
          Builder for KeyInfo objects.
private  Logger log
          Class logger.
private  X509KeyInfoGeneratorFactory.X509Options options
          The set of options to be used by the generator.
private  X509DataBuilder x509DataBuilder
          Builder for X509Data objects.
 
Constructor Summary
protected X509KeyInfoGeneratorFactory.X509KeyInfoGenerator(X509KeyInfoGeneratorFactory.X509Options newOptions)
          Constructor.
 
Method Summary
 KeyInfo generate(Credential credential)
          Generate a new KeyInfo object based on keying material and other information within a credential.
protected  String getIssuerName(X509Certificate cert)
          Get issuer name from a certificate, using the currently configured X500DNHandler and issuer DN output format.
protected  String getSubjectName(X509Certificate cert)
          Get subject name from a certificate, using the currently configured X500DNHandler and subject DN output format.
protected  void processCertKeyNameOptions(KeyInfo keyInfo, X509Certificate cert)
          Process the options related to generation of KeyName elements based on certificate data.
protected  void processCertX509DataOptions(X509Data x509Data, X509Certificate cert)
          Process the options related to generation of child elements of X509Data based on certificate data.
protected  void processCertX509IssuerSerial(X509Data x509Data, X509Certificate cert)
          Process the options related to generation of the X509IssuerSerial child element of X509Data based on certificate data.
protected  void processCertX509SKI(X509Data x509Data, X509Certificate cert)
          Process the options related to generation of the X509SKI child element of X509Data based on certificate data.
protected  void processCertX509SubjectName(X509Data x509Data, X509Certificate cert)
          Process the options related to generation of the X509SubjectDN child element of X509Data based on certificate data.
protected  void processCRLs(KeyInfo keyInfo, X509Data x509Data, X509Credential credential)
          Process the value of X509Credential.getCRLs().
protected  void processEntityCertificate(KeyInfo keyInfo, X509Data x509Data, X509Credential credential)
          Process the value of X509Credential.getEntityCertificate().
protected  void processEntityCertificateChain(KeyInfo keyInfo, X509Data x509Data, X509Credential credential)
          Process the value of X509Credential.getEntityCertificateChain().
protected  void processSubjectAltNameKeyNames(KeyInfo keyInfo, X509Certificate cert)
          Process the options related to generation of KeyName elements based on subject alternative name information within the certificate data.
protected  void processSubjectCNKeyName(KeyInfo keyInfo, X509Certificate cert)
          Process the options related to generation of KeyName elements based on the the common name field(s) of the certificate's subject DN.
protected  void processSubjectDNKeyName(KeyInfo keyInfo, X509Certificate cert)
          Process the options related to generation of KeyName elements based on the certificate's subject DN value.
 
Methods inherited from class org.opensaml.xml.security.credential.BasicKeyInfoGeneratorFactory.BasicKeyInfoGenerator
processEntityID, processKeyNames, processPublicKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private final Logger log
Class logger.


options

private X509KeyInfoGeneratorFactory.X509Options options
The set of options to be used by the generator.


keyInfoBuilder

private KeyInfoBuilder keyInfoBuilder
Builder for KeyInfo objects.


x509DataBuilder

private X509DataBuilder x509DataBuilder
Builder for X509Data objects.

Constructor Detail

X509KeyInfoGeneratorFactory.X509KeyInfoGenerator

protected X509KeyInfoGeneratorFactory.X509KeyInfoGenerator(X509KeyInfoGeneratorFactory.X509Options newOptions)
Constructor.

Parameters:
newOptions - the options to be used by the generator
Method Detail

generate

public KeyInfo generate(Credential credential)
                 throws SecurityException
Generate a new KeyInfo object based on keying material and other information within a credential.

Specified by:
generate in interface KeyInfoGenerator
Overrides:
generate in class BasicKeyInfoGeneratorFactory.BasicKeyInfoGenerator
Parameters:
credential - the credential containing keying material and possibly other information
Returns:
a new KeyInfo object
Throws:
SecurityException - thrown if there is any error generating the new KeyInfo from the credential

processEntityCertificate

protected void processEntityCertificate(KeyInfo keyInfo,
                                        X509Data x509Data,
                                        X509Credential credential)
                                 throws SecurityException
Process the value of X509Credential.getEntityCertificate().

Parameters:
keyInfo - the KeyInfo that is being built
x509Data - the X509Data that is being built
credential - the Credential that is being processed
Throws:
SecurityException - thrown if the certificate data can not be encoded from the Java certificate object

processCertX509DataOptions

protected void processCertX509DataOptions(X509Data x509Data,
                                          X509Certificate cert)
Process the options related to generation of child elements of X509Data based on certificate data.

Parameters:
x509Data - the X509Data element being processed.
cert - the certificate being processed

processCertKeyNameOptions

protected void processCertKeyNameOptions(KeyInfo keyInfo,
                                         X509Certificate cert)
Process the options related to generation of KeyName elements based on certificate data.

Parameters:
keyInfo - the KeyInfo element being processed.
cert - the certificate being processed

processCertX509SubjectName

protected void processCertX509SubjectName(X509Data x509Data,
                                          X509Certificate cert)
Process the options related to generation of the X509SubjectDN child element of X509Data based on certificate data.

Parameters:
x509Data - the X509Data element being processed.
cert - the certificate being processed

processCertX509IssuerSerial

protected void processCertX509IssuerSerial(X509Data x509Data,
                                           X509Certificate cert)
Process the options related to generation of the X509IssuerSerial child element of X509Data based on certificate data.

Parameters:
x509Data - the X509Data element being processed.
cert - the certificate being processed

processCertX509SKI

protected void processCertX509SKI(X509Data x509Data,
                                  X509Certificate cert)
Process the options related to generation of the X509SKI child element of X509Data based on certificate data.

Parameters:
x509Data - the X509Data element being processed.
cert - the certificate being processed

getSubjectName

protected String getSubjectName(X509Certificate cert)
Get subject name from a certificate, using the currently configured X500DNHandler and subject DN output format.

Parameters:
cert - the certificate being processed
Returns:
the subject name

getIssuerName

protected String getIssuerName(X509Certificate cert)
Get issuer name from a certificate, using the currently configured X500DNHandler and issuer DN output format.

Parameters:
cert - the certificate being processed
Returns:
the issuer name

processSubjectDNKeyName

protected void processSubjectDNKeyName(KeyInfo keyInfo,
                                       X509Certificate cert)
Process the options related to generation of KeyName elements based on the certificate's subject DN value.

Parameters:
keyInfo - the KeyInfo element being processed.
cert - the certificate being processed

processSubjectCNKeyName

protected void processSubjectCNKeyName(KeyInfo keyInfo,
                                       X509Certificate cert)
Process the options related to generation of KeyName elements based on the the common name field(s) of the certificate's subject DN.

Parameters:
keyInfo - the KeyInfo element being processed.
cert - the certificate being processed

processSubjectAltNameKeyNames

protected void processSubjectAltNameKeyNames(KeyInfo keyInfo,
                                             X509Certificate cert)
Process the options related to generation of KeyName elements based on subject alternative name information within the certificate data.

Parameters:
keyInfo - the KeyInfo element being processed.
cert - the certificate being processed

processEntityCertificateChain

protected void processEntityCertificateChain(KeyInfo keyInfo,
                                             X509Data x509Data,
                                             X509Credential credential)
                                      throws SecurityException
Process the value of X509Credential.getEntityCertificateChain().

Parameters:
keyInfo - the KeyInfo that is being built
x509Data - the X509Data that is being built
credential - the Credential that is being processed
Throws:
SecurityException - thrown if the certificate data can not be encoded from the Java certificate object

processCRLs

protected void processCRLs(KeyInfo keyInfo,
                           X509Data x509Data,
                           X509Credential credential)
                    throws SecurityException
Process the value of X509Credential.getCRLs().

Parameters:
keyInfo - the KeyInfo that is being built
x509Data - the X509Data that is being built
credential - the Credential that is being processed
Throws:
SecurityException - thrown if the CRL data can not be encoded from the Java certificate object


Copyright © 1999-2012. All Rights Reserved.