Package com.sun.identity.saml2.xmlsig
Class FMSigProvider
- java.lang.Object
-
- com.sun.identity.saml2.xmlsig.FMSigProvider
-
- All Implemented Interfaces:
SigProvider
public final class FMSigProvider extends Object implements SigProvider
FMSigProvideris an class for signing and verifying XML documents, it implementsSigProvider
-
-
Constructor Summary
Constructors Constructor Description FMSigProvider()Default Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Elementsign(String xmlString, String idValue, PrivateKey privateKey, X509Certificate cert)Sign the xml document node whose identifying attribute value is as supplied, using enveloped signatures and use exclusive xml canonicalization.booleanverify(String xmlString, String idValue, Set<X509Certificate> verificationCerts)Verify the signature of the xml document.
-
-
-
Method Detail
-
sign
public Element sign(String xmlString, String idValue, PrivateKey privateKey, X509Certificate cert) throws SAML2Exception
Sign the xml document node whose identifying attribute value is as supplied, using enveloped signatures and use exclusive xml canonicalization. The resulting signature is inserted after the first child node (normally Issuer element for SAML2) of the node to be signed.- Specified by:
signin interfaceSigProvider- Parameters:
xmlString- String representing an XML document to be signedidValue- id attribute value of the root node to be signedprivateKey- Signing keycert- Certificate which contain the public key correlated to the signing key; It if is not null, then the signature will include the certificate; Otherwise, the signature will not include any certificate- Returns:
- Element representing the signature element
- Throws:
SAML2Exception- if the document could not be signed
-
verify
public boolean verify(String xmlString, String idValue, Set<X509Certificate> verificationCerts) throws SAML2Exception
Description copied from interface:SigProviderVerify the signature of the xml document.- Specified by:
verifyin interfaceSigProvider- Parameters:
xmlString- String representing an signed XML document.idValue- id attribute value of the node whose signature is to be verified.verificationCerts- Certificates containing the public keys which may be used for signature verification; This certificate may also may be used to check against the certificate included in the signature.- Returns:
- true if the xml signature is verified, false otherwise.
- Throws:
SAML2Exception- if problem occurs during verification.
-
-