/** * Constructor AssertionWrapper creates a new AssertionWrapper instance. * * @param element of type Element * @throws UnmarshallingException when */ public AssertionWrapper(Element element) throws WSSecurityException { OpenSAMLUtil.initSamlEngine(); parseElement(element); fromDOM = true; }
/** * Method setSignature sets the signature of this AssertionWrapper object. * * @param signature the signature of this AssertionWrapper object. */ public void setSignature(Signature signature) { setSignature(signature, defaultSignatureDigestAlgorithm); }
/** * Initializes the OpenSAML library, loading default configurations. * * @throws ConfigurationException thrown if there is a problem initializing the OpenSAML library */ public static synchronized void bootstrap() throws ConfigurationException { initializeXMLSecurity(); initializeXMLTooling(xmlToolingConfigs); initializeArtifactBuilderFactories(); initializeGlobalSecurityConfiguration(); initializeParserPool(); }
/** * Create a DOM from the current XMLObject content. If the user-supplied doc is not null, * reparent the returned Element so that it is compatible with the user-supplied document. * * @param doc of type Document * @return Element */ public Element toDOM(Document doc) throws WSSecurityException { if (fromDOM && assertionElement != null) { parseElement(assertionElement); if (doc != null) { return (Element)doc.importNode(assertionElement, true); } return assertionElement; } assertionElement = OpenSAMLUtil.toDom(xmlObject, doc); return assertionElement; }
public String getId() { if (assertion != null) { return assertion.getId(); } return null; }
public Element getElement() throws WSSecurityException { if (samlElement != null) { return samlElement; } if (saml == null) { return null; } samlElement = saml.toDOM(document); return samlElement; }
/** * Create an enveloped signature on the assertion that has been created. * * @param issuerKeyName the Issuer KeyName to use with the issuerCrypto argument * @param issuerKeyPassword the Issuer Password to use with the issuerCrypto argument * @param issuerCrypto the Issuer Crypto instance * @param sendKeyValue whether to send the key value or not * @throws WSSecurityException */ public void signAssertion(String issuerKeyName, String issuerKeyPassword, Crypto issuerCrypto, boolean sendKeyValue) throws WSSecurityException { signAssertion(issuerKeyName, issuerKeyPassword, issuerCrypto, sendKeyValue, defaultCanonicalizationAlgorithm, defaultRSASignatureAlgorithm, defaultSignatureDigestAlgorithm); }
/** * Convert a SAML Assertion from a XMLObject to a DOM Element * * @param xmlObject of type XMLObject * @param doc of type Document * @return Element * @throws MarshallingException * @throws SignatureException */ public static Element toDom( XMLObject xmlObject, Document doc ) throws WSSecurityException { return toDom(xmlObject, doc, true); }
@Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { for (Callback callback : callbacks) { if (callback instanceof SAMLCallback) { SAMLCallback samlCallback = (SAMLCallback) callback; samlCallback.setAssertionElement(this.assertionElement); } } } }
/** * Initializes the OpenSAML library, loading default configurations. * * @throws ConfigurationException thrown if there is a problem initializing the OpenSAML library */ public static synchronized void bootstrap() throws ConfigurationException { initializeXMLSecurity(); initializeXMLTooling(xmlToolingConfigs); initializeArtifactBuilderFactories(); initializeGlobalSecurityConfiguration(); initializeParserPool(); }
/** * Constructor AssertionWrapper creates a new AssertionWrapper instance. * * @param element of type Element * @throws UnmarshallingException when */ public AssertionWrapper(Element element) throws WSSecurityException { OpenSAMLUtil.initSamlEngine(); parseElement(element); fromDOM = true; }
public String getId() { if (assertion != null) { return assertion.getId(); } return null; }
public Element getElement() throws WSSecurityException { if (samlElement != null) { return samlElement; } if (saml == null) { return null; } samlElement = saml.toDOM(document); return samlElement; }
/** * Create an enveloped signature on the assertion that has been created. * * @param issuerKeyName the Issuer KeyName to use with the issuerCrypto argument * @param issuerKeyPassword the Issuer Password to use with the issuerCrypto argument * @param issuerCrypto the Issuer Crypto instance * @param sendKeyValue whether to send the key value or not * @throws WSSecurityException */ public void signAssertion(String issuerKeyName, String issuerKeyPassword, Crypto issuerCrypto, boolean sendKeyValue) throws WSSecurityException { signAssertion(issuerKeyName, issuerKeyPassword, issuerCrypto, sendKeyValue, defaultCanonicalizationAlgorithm, defaultRSASignatureAlgorithm, defaultSignatureDigestAlgorithm); }
/** * Method setSignature sets the signature of this AssertionWrapper object. * * @param signature the signature of this AssertionWrapper object. */ public void setSignature(Signature signature) { setSignature(signature, defaultSignatureDigestAlgorithm); }
/** * Convert a SAML Assertion from a XMLObject to a DOM Element * * @param xmlObject of type XMLObject * @param doc of type Document * @return Element * @throws MarshallingException * @throws SignatureException */ public static Element toDom( XMLObject xmlObject, Document doc ) throws WSSecurityException { return toDom(xmlObject, doc, true); }
/** * Get the id generated during <code>prepare()</code>. * * Returns the the value of wsu:Id attribute of this Timestamp. * * @return Return the wsu:Id of this token or null if <code>prepareToken()</code> * was not called before. */ public String getId() { if (saml == null) { return null; } return saml.getId(); }
/** * Method assertionToString ... * * @return String */ public String assertionToString() throws WSSecurityException { if (assertionElement == null) { Element element = toDOM(null); return DOM2Writer.nodeToString(element); } return DOM2Writer.nodeToString(assertionElement); }
/** * Create an enveloped signature on the assertion that has been created. * * @param issuerKeyName the Issuer KeyName to use with the issuerCrypto argument * @param issuerKeyPassword the Issuer Password to use with the issuerCrypto argument * @param issuerCrypto the Issuer Crypto instance * @param sendKeyValue whether to send the key value or not * @param canonicalizationAlgorithm the canonicalization algorithm to be used for signing * @param signatureAlgorithm the signature algorithm to be used for signing * @throws WSSecurityException */ public void signAssertion(String issuerKeyName, String issuerKeyPassword, Crypto issuerCrypto, boolean sendKeyValue, String canonicalizationAlgorithm, String signatureAlgorithm) throws WSSecurityException { signAssertion(issuerKeyName, issuerKeyPassword, issuerCrypto, sendKeyValue, canonicalizationAlgorithm, signatureAlgorithm, defaultSignatureDigestAlgorithm); }
/** * Get the id generated during <code>prepare()</code>. * * Returns the the value of wsu:Id attribute of this Timestamp. * * @return Return the wsu:Id of this token or null if <code>prepareToken()</code> * was not called before. */ public String getId() { if (saml == null) { return null; } return saml.getId(); }