Methods Summary |
---|
public void | addInstance(java.lang.String instance, byte[] key)
byte [] newKey = new byte[key.length];
System.arraycopy(key,0,newKey,0,key.length);
if (instance == null) {
this.secret = newKey;
} else {
secretMap.put(instance, newKey);
}
|
private com.sun.xml.ws.security.trust.elements.str.SecurityTokenReference | createSecurityTokenReference(java.lang.String id, boolean unattached)
final String uri = (unattached?id:"#"+id);
final Reference ref = factory.createDirectReference(WSSCConstants.SECURITY_CONTEXT_TOKEN_TYPE, uri);
return factory.createSecurityTokenReference(ref);
|
public java.util.Date | getCreationTime()
return new Date(creationTime.getTime());
|
public java.util.Date | getExpirationTime()
return new Date(expirationTime.getTime());
|
public java.lang.String | getExternalId()
return extId;
|
public java.lang.String | getIdentifier()
return identifier;
|
public java.util.Set | getInstanceKeys()
return null;
// TBD
//return secretMap.keySet();
|
public byte[] | getInstanceSecret(java.lang.String instance)
return secretMap.get(instance);
|
public com.sun.xml.ws.security.IssuedTokenContext | getIssuedTokenContext()
final IssuedTokenContext itc = new IssuedTokenContextImpl();
itc.setCreationTime(this.getCreationTime());
itc.setExpirationTime(this.getExpirationTime());
itc.setProofKey(this.getSecret());
itc.setSecurityContextTokenInfo(this);
// create security token based on id and extId
URI uri = URI.create(this.getIdentifier());
final SecurityContextToken token = factory.createSecurityContextToken(
uri, null , this.getExternalId());
itc.setSecurityToken(token);
// Create references
final SecurityTokenReference attachedReference = createSecurityTokenReference(token.getWsuId(),false);
//RequestedAttachedReference rar = factory.createRequestedAttachedReference(attachedReference);
final SecurityTokenReference unattachedRef = createSecurityTokenReference(token.getIdentifier().toString(), true);
//RequestedUnattachedReference rur = factory.createRequestedUnattachedReference(unattachedRef);
itc.setAttachedSecurityTokenReference(attachedReference);
itc.setUnAttachedSecurityTokenReference(unattachedRef);
return itc;
|
public com.sun.xml.ws.security.IssuedTokenContext | getIssuedTokenContext(com.sun.xml.ws.security.SecurityTokenReference reference)
// get str id -> get Session corresponding to id
// from session get corresponding SCTInfo ->
// return sctinfo's IssuedTokenContext.
final String id = reference.getId();
final Session session =
SessionManager.getSessionManager().getSession(id);
return session.getSecurityInfo().getIssuedTokenContext();
|
public byte[] | getSecret()
byte [] newSecret = new byte[secret.length];
System.arraycopy(secret,0,newSecret,0,secret.length);
return newSecret;
|
public void | setCreationTime(java.util.Date creationTime)
this.creationTime = new Date(creationTime.getTime());
|
public void | setExpirationTime(java.util.Date expirationTime)
this.expirationTime = new Date(expirationTime.getTime());
|
public void | setExternalId(java.lang.String externalId)
this.extId = externalId;
|
public void | setIdentifier(java.lang.String identifier)
this.identifier = identifier;
|