Class Saml2X509Credential
- java.lang.Object
-
- org.springframework.security.saml2.core.Saml2X509Credential
-
public final class Saml2X509Credential extends java.lang.Object
An object for holding a public certificate, any associated private key, and its intended usages (Line 584, Section 4.3 Credentials).- Since:
- 5.4
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Saml2X509Credential.Saml2X509CredentialType
-
Constructor Summary
Constructors Constructor Description Saml2X509Credential(java.security.cert.X509Certificate certificate, Saml2X509Credential.Saml2X509CredentialType... types)
Creates aSaml2X509Credential
using the provided parametersSaml2X509Credential(java.security.PrivateKey privateKey, java.security.cert.X509Certificate certificate, java.util.Set<Saml2X509Credential.Saml2X509CredentialType> types)
Creates aSaml2X509Credential
using the provided parametersSaml2X509Credential(java.security.PrivateKey privateKey, java.security.cert.X509Certificate certificate, Saml2X509Credential.Saml2X509CredentialType... types)
Creates aSaml2X509Credential
using the provided parameters
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Saml2X509Credential
decryption(java.security.PrivateKey privateKey, java.security.cert.X509Certificate certificate)
Create aSaml2X509Credential
that can be used for decryption.static Saml2X509Credential
encryption(java.security.cert.X509Certificate certificate)
Create aSaml2X509Credential
that can be used for encryption.boolean
equals(java.lang.Object o)
java.security.cert.X509Certificate
getCertificate()
Get the public certificate for this credentialjava.util.Set<Saml2X509Credential.Saml2X509CredentialType>
getCredentialTypes()
List all this credential's intended usagesjava.security.PrivateKey
getPrivateKey()
Get the private key for this credentialint
hashCode()
boolean
isDecryptionCredential()
Indicate whether this credential can be used for decryptionboolean
isEncryptionCredential()
Indicate whether this credential can be used for encryptionboolean
isSigningCredential()
Indicate whether this credential can be used for signingboolean
isVerificationCredential()
Indicate whether this credential can be used for verificationstatic Saml2X509Credential
signing(java.security.PrivateKey privateKey, java.security.cert.X509Certificate certificate)
Create aSaml2X509Credential
that can be used for signing.static Saml2X509Credential
verification(java.security.cert.X509Certificate certificate)
Create aSaml2X509Credential
that can be used for verification.
-
-
-
Constructor Detail
-
Saml2X509Credential
public Saml2X509Credential(java.security.cert.X509Certificate certificate, Saml2X509Credential.Saml2X509CredentialType... types)
Creates aSaml2X509Credential
using the provided parameters- Parameters:
certificate
- the credential's public certificiatetypes
- the credential's intended usages, must be one ofSaml2X509Credential.Saml2X509CredentialType.VERIFICATION
orSaml2X509Credential.Saml2X509CredentialType.ENCRYPTION
or both.
-
Saml2X509Credential
public Saml2X509Credential(java.security.PrivateKey privateKey, java.security.cert.X509Certificate certificate, Saml2X509Credential.Saml2X509CredentialType... types)
Creates aSaml2X509Credential
using the provided parameters- Parameters:
privateKey
- the credential's private keycertificate
- the credential's public certificatetypes
- the credential's intended usages, must be one ofSaml2X509Credential.Saml2X509CredentialType.SIGNING
orSaml2X509Credential.Saml2X509CredentialType.DECRYPTION
or both.
-
Saml2X509Credential
public Saml2X509Credential(java.security.PrivateKey privateKey, java.security.cert.X509Certificate certificate, java.util.Set<Saml2X509Credential.Saml2X509CredentialType> types)
Creates aSaml2X509Credential
using the provided parameters- Parameters:
privateKey
- the credential's private keycertificate
- the credential's public certificatetypes
- the credential's intended usages
-
-
Method Detail
-
encryption
public static Saml2X509Credential encryption(java.security.cert.X509Certificate certificate)
Create aSaml2X509Credential
that can be used for encryption.- Parameters:
certificate
- the certificate to use for encryption- Returns:
- an encrypting
Saml2X509Credential
-
verification
public static Saml2X509Credential verification(java.security.cert.X509Certificate certificate)
Create aSaml2X509Credential
that can be used for verification.- Parameters:
certificate
- the certificate to use for verification- Returns:
- a verifying
Saml2X509Credential
-
decryption
public static Saml2X509Credential decryption(java.security.PrivateKey privateKey, java.security.cert.X509Certificate certificate)
Create aSaml2X509Credential
that can be used for decryption.- Parameters:
privateKey
- the private key to use for decryptioncertificate
- the certificate to use for decryption- Returns:
- an decrypting
Saml2X509Credential
-
signing
public static Saml2X509Credential signing(java.security.PrivateKey privateKey, java.security.cert.X509Certificate certificate)
Create aSaml2X509Credential
that can be used for signing.- Parameters:
privateKey
- the private key to use for signingcertificate
- the certificate to use for signing- Returns:
- a signing
Saml2X509Credential
-
getPrivateKey
public java.security.PrivateKey getPrivateKey()
Get the private key for this credential- Returns:
- the private key, may be null
- See Also:
Saml2X509Credential(PrivateKey, X509Certificate, Saml2X509CredentialType...)
-
getCertificate
public java.security.cert.X509Certificate getCertificate()
Get the public certificate for this credential- Returns:
- the public certificate
-
isSigningCredential
public boolean isSigningCredential()
Indicate whether this credential can be used for signing- Returns:
- true if the credential has a
Saml2X509Credential.Saml2X509CredentialType.SIGNING
type
-
isDecryptionCredential
public boolean isDecryptionCredential()
Indicate whether this credential can be used for decryption- Returns:
- true if the credential has a
Saml2X509Credential.Saml2X509CredentialType.DECRYPTION
type
-
isVerificationCredential
public boolean isVerificationCredential()
Indicate whether this credential can be used for verification- Returns:
- true if the credential has a
Saml2X509Credential.Saml2X509CredentialType.VERIFICATION
type
-
isEncryptionCredential
public boolean isEncryptionCredential()
Indicate whether this credential can be used for encryption- Returns:
- true if the credential has a
Saml2X509Credential.Saml2X509CredentialType.ENCRYPTION
type
-
getCredentialTypes
public java.util.Set<Saml2X509Credential.Saml2X509CredentialType> getCredentialTypes()
List all this credential's intended usages- Returns:
- the set of this credential's intended usages
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-