public class DefaultSecurityEnvironmentImpl extends Object implements SecurityEnvironment
| Constructor and Description |
|---|
DefaultSecurityEnvironmentImpl(CallbackHandler cHandler) |
DefaultSecurityEnvironmentImpl(CallbackHandler cHandler,
Properties confAssertions) |
| Modifier and Type | Method and Description |
|---|---|
String |
authenticateUser(Map context,
String username)
Authenticate the user given the username and context.
|
boolean |
authenticateUser(Map context,
String username,
String password)
Authenticate the user against a list of known username-password
pairs.
|
boolean |
authenticateUser(Map context,
String username,
String passwordDigest,
String nonce,
String created)
Authenticate the user given the password digest.
|
KerberosContext |
doKerberosLogin()
Perform a Kerberos Login and return a Kerberos Context
KerberosContext stores the secretKey, GSSContext, kerberos BST etc
|
KerberosContext |
doKerberosLogin(byte[] tokenValue)
Perform a Kerberos Login and return a Kerberos Context
KerberosContext stores the secretKey, GSSContext, kerberos BST etc
|
SignatureKeyCallback.AliasPrivKeyCertRequest |
getAliasPrivKeyCertRequest(String certIdentifier) |
CallbackHandler |
getCallbackHandler() |
X509Certificate |
getCertificate(Map context,
BigInteger serialNumber,
String issuerName) |
X509Certificate |
getCertificate(Map context,
byte[] keyIdentifier) |
X509Certificate |
getCertificate(Map context,
byte[] identifier,
String valueType) |
X509Certificate |
getCertificate(Map context,
PublicKey publicKey,
boolean forSign) |
X509Certificate |
getCertificate(Map context,
String alias,
boolean forSigning) |
X509Certificate |
getDefaultCertificate(Map context)
Retrieves a reasonable default value for the current user's
X509Certificate if one exists.
|
PrivateKey |
getDefaultPrivateKey(Map context) |
SignatureKeyCallback.PrivKeyCertRequest |
getDefaultPrivKeyCertRequest(Map context) |
String |
getPassword(Map context) |
PrivateKey |
getPrivateKey(Map context,
BigInteger serialNumber,
String issuerName) |
PrivateKey |
getPrivateKey(Map context,
byte[] keyIdentifier) |
PrivateKey |
getPrivateKey(Map context,
byte[] identifier,
String valueType) |
PrivateKey |
getPrivateKey(Map context,
PublicKey publicKey,
boolean forSign) |
PrivateKey |
getPrivateKey(Map context,
String alias) |
PrivateKey |
getPrivateKey(Map context,
X509Certificate cert) |
PublicKey |
getPublicKey(Map context,
BigInteger serialNumber,
String issuerName) |
PublicKey |
getPublicKey(Map context,
byte[] keyIdentifier) |
PublicKey |
getPublicKey(Map context,
byte[] identifier,
String valueType) |
SecretKey |
getSecretKey(Map context,
String alias,
boolean encryptMode) |
Subject |
getSubject() |
static Subject |
getSubject(FilterProcessingContext context) |
static Subject |
getSubject(Map context) |
String |
getUsername(Map context) |
boolean |
isSelfCertificate(X509Certificate cert) |
Element |
locateSAMLAssertion(Map context,
Element binding,
String assertionId,
Document ownerDoc)
Locate and return a SAML Assertion, given the Authority binding and assertionId
|
static WssSoapFaultException |
newSOAPFaultException(QName faultCode,
String faultstring,
Throwable th)
Create and initialize a WssSoapFaultException.
|
AuthenticationTokenPolicy.SAMLAssertionBinding |
populateSAMLPolicy(Map fpcontext,
AuthenticationTokenPolicy.SAMLAssertionBinding policy,
DynamicApplicationContext context)
Locate and update the Policy argument with the SAML Assertion and/or the AuthorityBinding
and Assertion ID information.
|
void |
updateOtherPartySubject(Subject subject,
Assertion assertion)
Update the public credentials of the subject of the party
whose Assertion is given.
|
void |
updateOtherPartySubject(Subject subject,
GSSName clientCred,
GSSCredential gssCred)
Update the principal/credentials of the requesting party subject
|
void |
updateOtherPartySubject(Subject subject,
Key secretKey) |
void |
updateOtherPartySubject(Subject subject,
String ek) |
void |
updateOtherPartySubject(Subject subject,
String username,
String password)
Update the public/private credentials of the subject of the party
whose username password pair is given.
|
void |
updateOtherPartySubject(Subject subject,
Subject bootStrapSubject)
Update the principal/credentials of the requesting party subject
|
void |
updateOtherPartySubject(Subject subject,
X509Certificate cert)
Update the public credentials of the subject of the party
whose certificate is given.
|
void |
updateOtherPartySubject(Subject subject,
XMLStreamReader assertion)
Update the public credentials of the subject of the party
whose Assertion is given.
|
boolean |
validateAndCacheNonce(Map context,
String nonce,
String created,
long nonceAge)
Validate the given nonce.
|
boolean |
validateCertificate(X509Certificate cert,
Map context)
Validate an X509Certificate.
|
void |
validateCreationTime(Map context,
String creationTime,
long maxClockSkew,
long timestampFreshnessLimit)
Validate the creation time.
|
void |
validateSAMLAssertion(Map context,
Element assertion)
Validate the received SAML Assertion
Validations can include validating the Issuer and the Saml User, SAML Version etc.
|
void |
validateSAMLAssertion(Map context,
XMLStreamReader assertion)
Validate the received SAML Assertion
Validations can include validating the Issuer and the Saml User, SAML Version etc.
|
boolean |
validateSamlIssuer(String issuer) |
boolean |
validateSamlUser(String user,
String domain,
String format) |
void |
validateTimestamp(Map context,
String created,
String expires,
long maxClockSkew,
long freshnessLimit) |
void |
validateTimestamp(Map context,
Timestamp timestamp,
long maxClockSkew,
long freshnessLimit)
Validate the creation time.
|
protected static final Logger log
public DefaultSecurityEnvironmentImpl(CallbackHandler cHandler)
public DefaultSecurityEnvironmentImpl(CallbackHandler cHandler, Properties confAssertions)
public X509Certificate getDefaultCertificate(Map context) throws XWSSecurityException
SecurityEnvironmentgetDefaultCertificate in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesXWSSecurityExceptionpublic SignatureKeyCallback.PrivKeyCertRequest getDefaultPrivKeyCertRequest(Map context) throws XWSSecurityException
XWSSecurityExceptionpublic SignatureKeyCallback.AliasPrivKeyCertRequest getAliasPrivKeyCertRequest(String certIdentifier) throws XWSSecurityException
XWSSecurityExceptionpublic PrivateKey getDefaultPrivateKey(Map context) throws XWSSecurityException
XWSSecurityExceptionpublic SecretKey getSecretKey(Map context, String alias, boolean encryptMode) throws XWSSecurityException
getSecretKey in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesalias - the alias for identifying the SecretKeyencryptMode - whether this request is for an Encrypt or Decrypt operationXWSSecurityException - if there was an error while trying to locate the SecretKeypublic X509Certificate getCertificate(Map context, String alias, boolean forSigning) throws XWSSecurityException
getCertificate in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesalias - the alias for identifying the certificateforSigning - whether this request is for a Sign operation or EncryptXWSSecurityException - if there was an error while trying to locate the Cerificatepublic X509Certificate getCertificate(Map context, PublicKey publicKey, boolean forSign) throws XWSSecurityException
getCertificate in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiespublicKey - the publicKeyforSign - set to true if the public key is to be used for SignatureVerificationXWSSecurityException - if there was an error while trying to locate the PublicKeypublic PrivateKey getPrivateKey(Map context, String alias) throws XWSSecurityException
getPrivateKey in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesalias - the alias for identifying the PrivateKeyXWSSecurityException - if there was an error while trying to locate the PrivateKeypublic PrivateKey getPrivateKey(Map context, byte[] identifier, String valueType) throws XWSSecurityException
getPrivateKey in interface SecurityEnvironmentXWSSecurityExceptionpublic PrivateKey getPrivateKey(Map context, byte[] keyIdentifier) throws XWSSecurityException
getPrivateKey in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertieskeyIdentifier - an Opaque identifier indicating
the X509 certificate.XWSSecurityException - if there was an error while trying to locate the PrivateKeypublic PrivateKey getPrivateKey(Map context, BigInteger serialNumber, String issuerName) throws XWSSecurityException
getPrivateKey in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesserialNumber - the serialNumber of the certificateissuerName - the issuerName of the certificateXWSSecurityException - if there was an error while trying to locate the PrivateKeypublic PublicKey getPublicKey(Map context, byte[] identifier, String valueType) throws XWSSecurityException
getPublicKey in interface SecurityEnvironmentXWSSecurityExceptionpublic PublicKey getPublicKey(Map context, byte[] keyIdentifier) throws XWSSecurityException
getPublicKey in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertieskeyIdentifier - an Opaque identifier indicating
the X509 certificate.XWSSecurityException - if there was an error while trying to locate the PublicKeypublic X509Certificate getCertificate(Map context, byte[] identifier, String valueType) throws XWSSecurityException
getCertificate in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesidentifier - an Opaque identifier indicating the X509 certificate.XWSSecurityException - if there was an error while trying to locate the X509Certificatepublic X509Certificate getCertificate(Map context, byte[] keyIdentifier) throws XWSSecurityException
getCertificate in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertieskeyIdentifier - an Opaque identifier indicating
the X509 certificate.XWSSecurityException - if there was an error while trying to locate the X509Certificatepublic PublicKey getPublicKey(Map context, BigInteger serialNumber, String issuerName) throws XWSSecurityException
getPublicKey in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesserialNumber - the serialNumber of the certificateissuerName - the issuerName of the certificateXWSSecurityException - if there was an error while trying to locate the PublicKeypublic X509Certificate getCertificate(Map context, BigInteger serialNumber, String issuerName) throws XWSSecurityException
getCertificate in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesserialNumber - the serialNumber of the certificateissuerName - the issuerName of the certificateXWSSecurityException - if there was an error while trying to locate the X509Certificatepublic boolean validateCertificate(X509Certificate cert, Map context) throws XWSSecurityException
SecurityEnvironmentvalidateCertificate in interface SecurityEnvironmentcert - the X509Certificate to be validatedcontext - Map of application and integration-layer specific propertiesXWSSecurityException - if there is some problem during validation.
public boolean validateCertificate(X509Certificate cert)
throws XWSSecurityException;
/
/**
Validate an X509Certificate.public void updateOtherPartySubject(Subject subject, String username, String password)
SecurityEnvironmentupdateOtherPartySubject in interface SecurityEnvironmentsubject - the Subject of the requesting partyusername - the username of the requesting partypassword - the password of the requesting partypublic void updateOtherPartySubject(Subject subject, X509Certificate cert)
SecurityEnvironmentupdateOtherPartySubject in interface SecurityEnvironmentsubject - the Subject of the requesting partycert - the X509Certificate of the requesting partypublic void updateOtherPartySubject(Subject subject, Assertion assertion)
SecurityEnvironmentupdateOtherPartySubject in interface SecurityEnvironmentsubject - the Subject of the requesting partyassertion - the SAML Assertion of the requesting partypublic static Subject getSubject(FilterProcessingContext context)
public PrivateKey getPrivateKey(Map context, X509Certificate cert) throws XWSSecurityException
getPrivateKey in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiescert - the X509CertificateXWSSecurityException - if there was an error while trying to locate the PrivateKeypublic PrivateKey getPrivateKey(Map context, PublicKey publicKey, boolean forSign) throws XWSSecurityException
getPrivateKey in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiespublicKey - the publicKeyforSign - set to true if the purpose is SignatureXWSSecurityException - if there was an error while trying to locate the PrivateKeypublic Subject getSubject()
getSubject in interface SecurityEnvironmentpublic boolean authenticateUser(Map context, String username, String passwordDigest, String nonce, String created) throws XWSSecurityException
SecurityEnvironmentauthenticateUser in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesusername - the usernamepasswordDigest - the digested passwordnonce - the nonce which was part of the digestcreated - the creation time which was part of the digestXWSSecurityException - if there was an error while trying to authenticate the usernamepublic boolean authenticateUser(Map context, String username, String password) throws XWSSecurityException
SecurityEnvironmentauthenticateUser in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesusername - the usernamepassword - the passwordXWSSecurityException - if there was an error while trying to authenticate the usernamepublic String authenticateUser(Map context, String username) throws XWSSecurityException
SecurityEnvironmentauthenticateUser in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesusername - the usernameXWSSecurityException - if there was an error while trying to authenticate the usernamepublic void validateCreationTime(Map context, String creationTime, long maxClockSkew, long timestampFreshnessLimit) throws XWSSecurityException
SecurityEnvironmentvalidateCreationTime in interface SecurityEnvironmentcreationTime - context - a Map of application and integration-layer specific propertiesmaxClockSkew - (in milliseconds) the maximum clockskewtimestampFreshnessLimit - (in milliseconds) the limit for which timestamps
are considered freshXWSSecurityExceptionXWSSecurityException - if there was an error while trying to validate the creationTimepublic boolean validateSamlIssuer(String issuer)
public String getUsername(Map context) throws XWSSecurityException
getUsername in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesXWSSecurityException - if there was an error while trying obtain the usernamepublic String getPassword(Map context) throws XWSSecurityException
getPassword in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesXWSSecurityException - if there was an error while trying obtain the passwordpublic void validateTimestamp(Map context, Timestamp timestamp, long maxClockSkew, long freshnessLimit) throws XWSSecurityException
SecurityEnvironmentvalidateTimestamp in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiestimestamp - the Timestamp elementmaxClockSkew - (in milliseconds) the maximum clockskewfreshnessLimit - (in milliseconds) the limit for which timestamps
are considered freshXWSSecurityException - if there was an error while trying validate the Timestamppublic void validateTimestamp(Map context, String created, String expires, long maxClockSkew, long freshnessLimit) throws XWSSecurityException
validateTimestamp in interface SecurityEnvironmentXWSSecurityExceptionpublic static WssSoapFaultException newSOAPFaultException(QName faultCode, String faultstring, Throwable th)
public void validateSAMLAssertion(Map context, Element assertion) throws XWSSecurityException
SecurityEnvironmentvalidateSAMLAssertion in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesassertion - the Assertion to be validatedXWSSecurityException - if there was an error while validating the SAML Assertionpublic Element locateSAMLAssertion(Map context, Element binding, String assertionId, Document ownerDoc) throws XWSSecurityException
SecurityEnvironmentlocateSAMLAssertion in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesbinding - an org.w3c.dom.Element representing the SAML AuthorityBindingassertionId - the Assertion ID of the SAML AssertionownerDoc - the owner document into which the returned SAML Assertion should be imported toXWSSecurityException - if there was an error while trying to locate the SAML Assertionpublic AuthenticationTokenPolicy.SAMLAssertionBinding populateSAMLPolicy(Map fpcontext, AuthenticationTokenPolicy.SAMLAssertionBinding policy, DynamicApplicationContext context) throws XWSSecurityException
SecurityEnvironmentpopulateSAMLPolicy in interface SecurityEnvironmentfpcontext - a Map of application and integration-layer specific propertiespolicy - the SAML Assertion Policy to be populatedcontext - the DynamicApplicationContextXWSSecurityException - if there was an error while trying to populate the SAML Assertion Policypublic CallbackHandler getCallbackHandler()
getCallbackHandler in interface SecurityEnvironmentpublic void validateSAMLAssertion(Map context, XMLStreamReader assertion) throws XWSSecurityException
SecurityEnvironmentvalidateSAMLAssertion in interface SecurityEnvironmentcontext - a Map of application and integration-layer specific propertiesassertion - the Assertion to be validatedXWSSecurityException - if there was an error while validating the SAML Assertionpublic void updateOtherPartySubject(Subject subject, XMLStreamReader assertion)
SecurityEnvironmentupdateOtherPartySubject in interface SecurityEnvironmentsubject - the Subject of the requesting partyassertion - the SAML Assertion of the requesting partypublic boolean isSelfCertificate(X509Certificate cert)
isSelfCertificate in interface SecurityEnvironmentpublic void updateOtherPartySubject(Subject subject, Subject bootStrapSubject)
SecurityEnvironmentupdateOtherPartySubject in interface SecurityEnvironmentsubject - the Subject of the requesting partybootStrapSubject - the bootstrap Credentials (during a SecureConversation Bootstrap) of the requesting partypublic KerberosContext doKerberosLogin() throws XWSSecurityException
SecurityEnvironmentdoKerberosLogin in interface SecurityEnvironmentXWSSecurityExceptionpublic KerberosContext doKerberosLogin(byte[] tokenValue) throws XWSSecurityException
SecurityEnvironmentdoKerberosLogin in interface SecurityEnvironmentXWSSecurityExceptionpublic void updateOtherPartySubject(Subject subject, GSSName clientCred, GSSCredential gssCred)
SecurityEnvironmentupdateOtherPartySubject in interface SecurityEnvironmentsubject - the Subject of the requesting partyclientCred - the GSSName of the requesting partypublic boolean validateAndCacheNonce(Map context, String nonce, String created, long nonceAge) throws XWSSecurityException
SecurityEnvironmentvalidateAndCacheNonce in interface SecurityEnvironmentcontext - a context containing runtime propertiesnonce - the encoded nonce valuecreated - the creation time valuenonceAge - the time in milliseconds for which this nonce
will be stored on the receiver.XWSSecurityException - if there was an error while trying to validate the NonceCopyright © 2005–2018 Oracle Corporation. All rights reserved.