Package org.miniorange.saml
Class MoSAMLUtils
java.lang.Object
org.miniorange.saml.MoSAMLUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringbase64EncodeRequest(org.opensaml.xml.XMLObject request, Boolean isHttpPostBinding) static org.opensaml.saml2.core.AuthnRequestbuildAuthnRequest(String issuer, String acsUrl, String destination, String nameIdFormat, Boolean forceAuthn, String authnContextClass) static org.opensaml.saml2.core.RequestedAuthnContextbuildRequestedAuthnContext(String authnContextClassRefValue) static org.opensaml.saml2.core.ResponsedecodeResponse(String encodedResponse) static org.opensaml.saml2.core.AssertiondecryptAssertion(org.opensaml.saml2.core.EncryptedAssertion encryptedAssertion, String publicKey, String privateKey) static StringdeserializePrivateCertificate(String certificate) static StringdeserializePublicCertificate(String certificate) static voidstatic StringgenerateRandomAlphaNumericKey(int bytes) static Stringstatic BooleanisValidPublicCertificate(String certificate) static StringsanitizeText(String text) static StringserializePrivateCertificate(String certificate) static StringserializePublicCertificate(String certificate) static org.opensaml.common.SignableSAMLObjectsignHttpPostRequest(org.opensaml.common.SignableSAMLObject request, String pubicKey, String privateKey) static StringsignHttpRedirectRequest(String requestQueryString, String sigAlgo, String pubicKey, String privateKey) static BooleanverifyCertificate(org.opensaml.xml.signature.SignableXMLObject response, String certificate)
-
Field Details
-
SAML_REQUEST_PARAM
- See Also:
-
RELAY_STATE_PARAM
- See Also:
-
SIGNATURE_ALGO_PARAM
- See Also:
-
SIGNATURE_PARAM
- See Also:
-
SAML_RESPONSE_PARAM
- See Also:
-
-
Constructor Details
-
MoSAMLUtils
public MoSAMLUtils()
-
-
Method Details
-
doBootstrap
public static void doBootstrap() -
sanitizeText
-
decodeResponse
public static org.opensaml.saml2.core.Response decodeResponse(String encodedResponse) throws Exception - Throws:
Exception
-
buildAuthnRequest
-
buildRequestedAuthnContext
public static org.opensaml.saml2.core.RequestedAuthnContext buildRequestedAuthnContext(String authnContextClassRefValue) -
decryptAssertion
public static org.opensaml.saml2.core.Assertion decryptAssertion(org.opensaml.saml2.core.EncryptedAssertion encryptedAssertion, String publicKey, String privateKey) throws CertificateException, InvalidKeySpecException, NoSuchAlgorithmException, org.opensaml.xml.encryption.DecryptionException - Throws:
CertificateExceptionInvalidKeySpecExceptionNoSuchAlgorithmExceptionorg.opensaml.xml.encryption.DecryptionException
-
verifyCertificate
public static Boolean verifyCertificate(org.opensaml.xml.signature.SignableXMLObject response, String certificate) throws org.opensaml.xml.validation.ValidationException, CertificateException, InvalidKeySpecException, NoSuchAlgorithmException - Throws:
org.opensaml.xml.validation.ValidationExceptionCertificateExceptionInvalidKeySpecExceptionNoSuchAlgorithmException
-
generateRandomString
-
serializePublicCertificate
-
deserializePublicCertificate
-
serializePrivateCertificate
-
deserializePrivateCertificate
-
base64EncodeRequest
public static String base64EncodeRequest(org.opensaml.xml.XMLObject request, Boolean isHttpPostBinding) throws Exception - Throws:
Exception
-
signHttpRedirectRequest
public static String signHttpRedirectRequest(String requestQueryString, String sigAlgo, String pubicKey, String privateKey) throws Exception - Throws:
Exception
-
isValidPublicCertificate
-
signHttpPostRequest
public static org.opensaml.common.SignableSAMLObject signHttpPostRequest(org.opensaml.common.SignableSAMLObject request, String pubicKey, String privateKey) throws Exception - Throws:
Exception
-
generateRandomAlphaNumericKey
-