Package org.miniorange.saml
Class MoSAMLUtils
java.lang.Object
org.miniorange.saml.MoSAMLUtils
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
base64EncodeRequest
(org.opensaml.xml.XMLObject request, Boolean isHttpPostBinding) static org.opensaml.saml2.core.AuthnRequest
buildAuthnRequest
(String issuer, String acsUrl, String destination, String nameIdFormat, Boolean forceAuthn, String authnContextClass) static org.opensaml.saml2.core.RequestedAuthnContext
buildRequestedAuthnContext
(String authnContextClassRefValue) static org.opensaml.saml2.core.Response
decodeResponse
(String encodedResponse) static org.opensaml.saml2.core.Assertion
decryptAssertion
(org.opensaml.saml2.core.EncryptedAssertion encryptedAssertion, String publicKey, String privateKey) static String
deserializePrivateCertificate
(String certificate) static String
deserializePublicCertificate
(String certificate) static void
static String
generateRandomAlphaNumericKey
(int bytes) static String
static Boolean
isValidPublicCertificate
(String certificate) static String
sanitizeText
(String text) static String
serializePrivateCertificate
(String certificate) static String
serializePublicCertificate
(String certificate) static org.opensaml.common.SignableSAMLObject
signHttpPostRequest
(org.opensaml.common.SignableSAMLObject request, String pubicKey, String privateKey) static String
signHttpRedirectRequest
(String requestQueryString, String sigAlgo, String pubicKey, String privateKey) static Boolean
verifyCertificate
(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:
CertificateException
InvalidKeySpecException
NoSuchAlgorithmException
org.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.ValidationException
CertificateException
InvalidKeySpecException
NoSuchAlgorithmException
-
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
-