Class KeyDescriptorBuilder
java.lang.Object
se.swedenconnect.opensaml.common.builder.AbstractSAMLObjectBuilder<KeyDescriptor>
se.swedenconnect.opensaml.saml2.metadata.build.KeyDescriptorBuilder
- All Implemented Interfaces:
SAMLObjectBuilder<KeyDescriptor>
A builder for
KeyDescriptor elements.
This builder only supports a subset of the possible elements of a key descriptor, but should be sufficient for most cases.
- Author:
- Martin Lindström (martin@idsec.se)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic KeyDescriptorBuilderbuilder()Utility method that creates a builder.certificate(InputStream certificate) Assigns an input stream to a certificate resource that is to be used as an X.509 data element of theKeyInfoelement within the key descriptor.certificate(String base64Encoding) Assigns a certificate (in Base64-encoded format) to be used as an X.509 data element of theKeyInfoelement within the key descriptor.certificate(X509Certificate certificate) Assigns a certificate to be used as an X.509 data element of theKeyInfoelement within the key descriptor.certificate(X509Credential credential) Assigns a certificate in OpenSAML credential format to be used as an X.509 data element of theKeyInfoelement within the key descriptor.encryptionMethods(String... algorithms) encryptionMethods(List<String> algorithms) Assigns a list of encryption methods.encryptionMethods(EncryptionMethod... algorithms) encryptionMethodsExt(List<EncryptionMethod> algorithms) Assigns a list of encryption methods.protected Class<KeyDescriptor> Returns the object type.Assigns the key name of theKeyInfoelement within the key descriptor.Assigns the usage type for the key descriptor.Methods inherited from class se.swedenconnect.opensaml.common.builder.AbstractSAMLObjectBuilder
build, getDefaultElementName, object
-
Constructor Details
-
KeyDescriptorBuilder
public KeyDescriptorBuilder()
-
-
Method Details
-
builder
Utility method that creates a builder.- Returns:
- a builder
-
getObjectType
Returns the object type.- Specified by:
getObjectTypein classAbstractSAMLObjectBuilder<KeyDescriptor>- Returns:
- the object type
-
use
Assigns the usage type for the key descriptor.- Parameters:
usageType- the usage type- Returns:
- the builder
-
keyName
Assigns the key name of theKeyInfoelement within the key descriptor.- Parameters:
name- the key name- Returns:
- the builder
-
certificate
Assigns a certificate to be used as an X.509 data element of theKeyInfoelement within the key descriptor.- Parameters:
certificate- the certificate- Returns:
- the builder
-
certificate
Assigns an input stream to a certificate resource that is to be used as an X.509 data element of theKeyInfoelement within the key descriptor.- Parameters:
certificate- the certificate resource- Returns:
- the builder
-
certificate
Assigns a certificate (in Base64-encoded format) to be used as an X.509 data element of theKeyInfoelement within the key descriptor.- Parameters:
base64Encoding- the base64 encoding (note: not PEM-format)- Returns:
- the builder
-
certificate
Assigns a certificate in OpenSAML credential format to be used as an X.509 data element of theKeyInfoelement within the key descriptor.- Parameters:
credential- the credential- Returns:
- the builder
-
encryptionMethods
Assigns a list of encryption methods.Note: the method only accepts algorithm URI:s. If you need to assign other parts of an
EncryptionMethodobject you must useencryptionMethodsExt(List).- Parameters:
algorithms- list of algorithms- Returns:
- the builder
-
encryptionMethods
- Parameters:
algorithms- list of algorithms- Returns:
- the builder
-
encryptionMethodsExt
Assigns a list of encryption methods.- Parameters:
algorithms- ordered list of encryption methods- Returns:
- the builder
-
encryptionMethods
- Parameters:
algorithms- ordered list of encryption methods- Returns:
- the builder
-