Package org.opensaml.xmlsec.keyinfo.impl
Class X509KeyInfoGeneratorFactory.X509KeyInfoGenerator
java.lang.Object
org.opensaml.xmlsec.keyinfo.impl.BasicKeyInfoGeneratorFactory.BasicKeyInfoGenerator
org.opensaml.xmlsec.keyinfo.impl.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
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.LoggerClass logger.The set of options to be used by the generator.private final XMLObjectBuilder<X509Data>Builder for X509Data objects. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedX509KeyInfoGenerator(X509KeyInfoGeneratorFactory.X509Options newOptions, Class<? extends KeyInfo> type) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiongenerate(Credential credential) Generate a new KeyInfo object based on keying material and other information within a credential.protected StringgetIssuerName(X509Certificate cert) Get issuer name from a certificate, using the currently configured X500DNHandler and issuer DN output format.protected StringGet subject name from a certificate, using the currently configured X500DNHandler and subject DN output format.protected voidprocessCertKeyNameOptions(KeyInfo keyInfo, X509Certificate cert) Process the options related to generation of KeyName elements based on certificate data.protected voidprocessCertX509DataOptions(X509Data x509Data, X509Certificate cert) Process the options related to generation of child elements of X509Data based on certificate data.protected voidprocessCertX509Digest(X509Data x509Data, X509Certificate cert) Process the options related to generation of the X509Digest child element of X509Data based on certificate data.protected voidprocessCertX509IssuerSerial(X509Data x509Data, X509Certificate cert) Process the options related to generation of the X509IssuerSerial child element of X509Data based on certificate data.protected voidprocessCertX509SKI(X509Data x509Data, X509Certificate cert) Process the options related to generation of the X509SKI child element of X509Data based on certificate data.protected voidprocessCertX509SubjectName(X509Data x509Data, X509Certificate cert) Process the options related to generation of the X509SubjectDN child element of X509Data based on certificate data.protected voidprocessCRLs(KeyInfo keyInfo, X509Data x509Data, X509Credential credential) Process the value ofX509Credential.getCRLs().protected voidprocessEntityCertificate(KeyInfo keyInfo, X509Data x509Data, X509Credential credential) Process the value ofX509Credential.getEntityCertificate().protected voidprocessEntityCertificateChain(KeyInfo keyInfo, X509Data x509Data, X509Credential credential) Process the value ofX509Credential.getEntityCertificateChain().protected voidprocessSubjectAltNameKeyNames(KeyInfo keyInfo, X509Certificate cert) Process the options related to generation of KeyName elements based on subject alternative name information within the certificate data.protected voidprocessSubjectCNKeyName(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 voidprocessSubjectDNKeyName(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.xmlsec.keyinfo.impl.BasicKeyInfoGeneratorFactory.BasicKeyInfoGenerator
buildKeyInfo, classToElementName, processEntityID, processKeyNames, processPublicKey
-
Field Details
-
log
private final org.slf4j.Logger logClass logger. -
options
The set of options to be used by the generator. -
x509DataBuilder
Builder for X509Data objects.
-
-
Constructor Details
-
X509KeyInfoGenerator
protected X509KeyInfoGenerator(X509KeyInfoGeneratorFactory.X509Options newOptions, Class<? extends KeyInfo> type) Constructor.- Parameters:
newOptions- the options to be used by the generatortype- the KeyInfo elemet type
-
-
Method Details
-
generate
Generate a new KeyInfo object based on keying material and other information within a credential.- Specified by:
generatein interfaceKeyInfoGenerator- Overrides:
generatein classBasicKeyInfoGeneratorFactory.BasicKeyInfoGenerator- Parameters:
credential- the credential containing keying material and possibly other information- Returns:
- a new KeyInfo object or null if nothing was generated
- Throws:
SecurityException- thrown if there is any error generating the new KeyInfo from the credential
-
processEntityCertificate
protected void processEntityCertificate(@Nonnull KeyInfo keyInfo, @Nonnull X509Data x509Data, @Nonnull X509Credential credential) throws SecurityException Process the value ofX509Credential.getEntityCertificate().- Parameters:
keyInfo- the KeyInfo that is being builtx509Data- the X509Data that is being builtcredential- 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(@Nonnull X509Data x509Data, @Nonnull X509Certificate cert) throws SecurityException 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- Throws:
SecurityException- if the certificate cannot be processed
-
processCertKeyNameOptions
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(@Nonnull X509Data x509Data, @Nonnull 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(@Nonnull X509Data x509Data, @Nonnull 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(@Nonnull X509Data x509Data, @Nonnull X509Certificate cert) throws SecurityException 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- Throws:
SecurityException- if there is an error in generating the subject key identifier
-
processCertX509Digest
protected void processCertX509Digest(@Nonnull X509Data x509Data, @Nonnull X509Certificate cert) throws SecurityException Process the options related to generation of the X509Digest child element of X509Data based on certificate data.- Parameters:
x509Data- the X509Data element being processed.cert- the certificate being processed- Throws:
SecurityException- if certificate cannot be digested
-
getSubjectName
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
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
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
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(@Nonnull KeyInfo keyInfo, @Nonnull 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(@Nonnull KeyInfo keyInfo, @Nonnull X509Data x509Data, @Nonnull X509Credential credential) throws SecurityException Process the value ofX509Credential.getEntityCertificateChain().- Parameters:
keyInfo- the KeyInfo that is being builtx509Data- the X509Data that is being builtcredential- 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(@Nonnull KeyInfo keyInfo, @Nonnull X509Data x509Data, @Nonnull X509Credential credential) throws SecurityException Process the value ofX509Credential.getCRLs().- Parameters:
keyInfo- the KeyInfo that is being builtx509Data- the X509Data that is being builtcredential- the Credential that is being processed- Throws:
SecurityException- thrown if the CRL data can not be encoded from the Java certificate object
-