use of org.apache.cxf.rs.security.jose.jws.JwsSignatureProvider in project cxf by apache.
the class JoseSessionTokenProvider method protectStateString.
private String protectStateString(String stateString) {
JwsSignatureProvider jws = getInitializedSigProvider();
JweEncryptionProvider jwe = getInitializedEncryptionProvider();
if (jws == null && jwe == null) {
throw new OAuthServiceException("Session token can not be created");
}
if (jws != null) {
stateString = JwsUtils.sign(jws, stateString, null);
}
if (jwe != null) {
stateString = jwe.encrypt(StringUtils.toBytesUTF8(stateString), null);
}
return stateString;
}
Aggregations