public class KeyDescriptorBuilder extends AbstractSAMLObjectBuilder<KeyDescriptor>
KeyDescriptor
elements.
This builder only supports a subset of the possible elements of a key descriptor, but should be sufficient for most cases.
Constructor and Description |
---|
KeyDescriptorBuilder() |
Modifier and Type | Method and Description |
---|---|
static KeyDescriptorBuilder |
builder()
Utility method that creates a builder.
|
KeyDescriptorBuilder |
certificate(InputStream certificate)
Assigns an input stream to a certificate resource that is to be used as a X.509 data element of the
KeyInfo
element within the key descriptor. |
KeyDescriptorBuilder |
certificate(String base64Encoding)
Assigns a certificate (in Base64-encoded format) to be used as a X.509 data element of the
KeyInfo element
within the key descriptor. |
KeyDescriptorBuilder |
certificate(X509Certificate certificate)
Assigns a certificate to be used as a X.509 data element of the
KeyInfo element within the key descriptor. |
KeyDescriptorBuilder |
certificate(X509Credential credential)
Assigns a certificate in OpenSAML credential format to be used as a X.509 data element of the
KeyInfo
element within the key descriptor. |
KeyDescriptorBuilder |
encryptionMethods(List<String> algorithms)
Assigns a list of encryption methods.
|
KeyDescriptorBuilder |
encryptionMethods(String... algorithms)
|
protected Class<KeyDescriptor> |
getObjectType()
Returns the object type.
|
KeyDescriptorBuilder |
keyName(String name)
Assigns the key name of the
KeyInfo element within the key descriptor. |
KeyDescriptorBuilder |
use(UsageType usageType)
Assigns the usage type for the key descriptor.
|
build, object
public static KeyDescriptorBuilder builder()
protected Class<KeyDescriptor> getObjectType()
getObjectType
in class AbstractSAMLObjectBuilder<KeyDescriptor>
public KeyDescriptorBuilder use(UsageType usageType)
usageType
- the usage typepublic KeyDescriptorBuilder keyName(String name)
KeyInfo
element within the key descriptor.name
- the key namepublic KeyDescriptorBuilder certificate(X509Certificate certificate)
KeyInfo
element within the key descriptor.certificate
- the certificatepublic KeyDescriptorBuilder certificate(InputStream certificate)
KeyInfo
element within the key descriptor.certificate
- the certificate resourcepublic KeyDescriptorBuilder certificate(String base64Encoding)
KeyInfo
element
within the key descriptor.base64Encoding
- the base64 encoding (note: not PEM-format)public KeyDescriptorBuilder certificate(X509Credential credential)
KeyInfo
element within the key descriptor.credential
- the credentialpublic KeyDescriptorBuilder encryptionMethods(List<String> algorithms)
Note: the method only accepts algorithm URI:s. If you need to assign other parts of an EncryptionMethod
object you must install the method manually and not via the builder.
algorithms
- list of algorithmspublic KeyDescriptorBuilder encryptionMethods(String... algorithms)
algorithms
- list of algorithmsCopyright © 2018 Litsec AB. All rights reserved.