public final class SAML2MetaSecurityUtils extends Object
SAML2MetaUtils
provides metadata security related util
methods.Modifier and Type | Field and Description |
---|---|
static String |
ATTR_ID |
static String |
ATTR_USE |
static String |
NS_MD_QUERY |
static String |
NS_META |
static String |
NS_XMLENC |
static String |
NS_XMLSIG |
static String |
PREFIX_MD_QUERY |
static String |
PREFIX_XMLENC |
static String |
PREFIX_XMLSIG |
static String |
TAG_ENTITY_DESCRIPTOR |
static String |
TAG_IDP_SSO_DESCRIPTOR |
static String |
TAG_KEY_DESCRIPTOR |
static String |
TAG_KEY_INFO |
static String |
TAG_SP_SSO_DESCRIPTOR |
Modifier and Type | Method and Description |
---|---|
static String |
buildX509Certificate(String certAlias) |
static String |
formatBase64BinaryElement(String xmlstr)
Restores Base64 encoded format.
|
static Document |
sign(String realm,
EntityDescriptorElement descriptor)
Signs the entity descriptor root element by the following rules:
Hosted Entity
If there is a signature already on the EntityDescriptor, removes it, then signs the EntityDescriptor.
|
static void |
updateProviderKeyInfo(String realm,
String entityID,
Set<String> certAliases,
boolean isSigning,
boolean isIDP,
String encAlgo,
int keySize)
Updates signing or encryption key info for SP or IDP.
|
static void |
verifySignature(Document doc)
Verifies signatures in entity descriptor represented by the
Document . |
public static final String NS_META
public static final String NS_XMLSIG
public static final String NS_XMLENC
public static final String NS_MD_QUERY
public static final String PREFIX_XMLSIG
public static final String PREFIX_XMLENC
public static final String PREFIX_MD_QUERY
public static final String TAG_KEY_INFO
public static final String TAG_KEY_DESCRIPTOR
public static final String TAG_ENTITY_DESCRIPTOR
public static final String TAG_SP_SSO_DESCRIPTOR
public static final String TAG_IDP_SSO_DESCRIPTOR
public static final String ATTR_USE
public static final String ATTR_ID
public static Document sign(String realm, EntityDescriptorElement descriptor) throws JAXBException, SAML2MetaException
realm
- The realm where the EntityDescriptor belongs to.descriptor
- The entity descriptor.Document
for the entity descriptor or null if no metadata signing key is found in
the configuration.SAML2MetaException
- if unable to sign the entity descriptor.JAXBException
- if the entity descriptor is invalid.public static void verifySignature(Document doc) throws SAML2MetaException
Document
.doc
- The document.SAML2MetaException
- if unable to verify the entity descriptor.public static String formatBase64BinaryElement(String xmlstr)
xmlstr
- The xml string containing element 'X509Certificate'.public static String buildX509Certificate(String certAlias) throws SAML2MetaException
SAML2MetaException
public static void updateProviderKeyInfo(String realm, String entityID, Set<String> certAliases, boolean isSigning, boolean isIDP, String encAlgo, int keySize) throws SAML2MetaException
realm
- Realm the entity resides.entityID
- ID of the entity to be updated.certAliases
- The set of certificate aliases to be set for the entity. If null or empty, existing key
information will be removed from the SP or IDP.isSigning
- true if this is signing certificate alias, false if
this is encryption certification alias.isIDP
- true if this is for IDP signing/encryption alias, false
if this is for SP signing/encryption aliasencAlgo
- Encryption algorithm URI, this is applicable for
encryption cert only.keySize
- Encryption key size, this is applicable for
encryption cert only.SAML2MetaException
- if failed to update the certificate alias
for the entity.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.