public final class WSFederationMetaSecurityUtils extends Object
WSFederationMetaUtils
provides metadata security related
utility methods.Modifier and Type | Field and Description |
---|---|
static String |
ATTR_ID |
static String |
ATTR_USE |
static String |
NS_META |
static String |
NS_XMLENC |
static String |
NS_XMLSIG |
static String |
PREFIX_XMLENC |
static String |
PREFIX_XMLSIG |
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)
Base64 encodes a certificate from the key store.
|
static String |
formatBase64BinaryElement(String xmlstr)
Restores Base64 encoded format.
|
static Document |
sign(FederationElement descriptor,
SPSSOConfigElement spconfig,
IDPSSOConfigElement idpconfig)
Signs service provider descriptor under entity descriptor if an cert
alias is found in service provider config and identity provider
descriptor under entity descriptor if an cert alias is found in
identity provider config.
|
static void |
updateProviderKeyInfo(String realm,
String entityID,
String certAlias,
boolean isIDP)
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 PREFIX_XMLSIG
public static final String PREFIX_XMLENC
public static final String TAG_KEY_INFO
public static final String TAG_KEY_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(FederationElement descriptor, SPSSOConfigElement spconfig, IDPSSOConfigElement idpconfig) throws JAXBException, WSFederationMetaException
descriptor
- The entity descriptor.spconfig
- The service provider config.idpconfig
- The identity provider config.Document
for the entity descriptor or null
if both cert aliases are not found.WSFederationMetaException
- if unable to sign the entity
descriptor.JAXBException
- if the entity descriptor is invalid.public static void verifySignature(Document doc) throws WSFederationMetaException
Document
.doc
- The document.WSFederationMetaException
- 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 WSFederationMetaException
certAlias
- alias of certificate to be encoded.WSFederationMetaException
public static void updateProviderKeyInfo(String realm, String entityID, String certAlias, boolean isIDP) throws WSFederationMetaException
realm
- Realm the entity resides.entityID
- ID of the entity to be updated.certAlias
- Alias of the certificate to be set to the entity. If
null, will remove existing key information from the SP or IDP.isIDP
- true if this is for IDP signing/encryption alias, false
if this is for SP signing/encryption aliasWSFederationMetaException
- if failed to update the certificate
alias for the entity.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.