-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Labels
in: saml2An issue in SAML2 modulesAn issue in SAML2 modulestype: enhancementA general enhancementA general enhancement
Milestone
Description
Saml2X509Credential
constructors are somewhat complicated to use.
For example, there are possible constructs that don't make sense:
new Saml2X509Credential(privateKey, x509Cerificate, Saml2X509CredentialType.ENCRYPTION)
The above is awkward in the context of SAML 2.0 since the common use case for encryption is to encrypt something using the other party's public certificate, not their private key as well.
Also, some constructs are possible at compile-time, but then throw an exception at runtime:
new Saml2X509Credential(x509Cerificate, Saml2X509CredentialType.DECRYPTION)
When run, the above will error because no private key was supplied.
Both of these scenarios can be addressed by adding some simple static factories to Saml2X509Credential
like:
public static Saml2X509Credential encryption(X509Certificiate certificate) { ... }
public static Saml2X509Credential decryption(PrivateKey key, X509Certificate certificate) { ... }
The nice thing about these as well is that they remove the application's need to work with the Saml2X509CredentialType
class, further simplifying their application.
Metadata
Metadata
Assignees
Labels
in: saml2An issue in SAML2 modulesAn issue in SAML2 modulestype: enhancementA general enhancementA general enhancement