use of org.jose4j.jwk.OctetSequenceJsonWebKey in project cas by apereo.
the class EncodingUtils method generateJsonWebKey.
/**
* Generate octet json web key of given size .
*
* @param size the size
* @return the key
*/
public static String generateJsonWebKey(final int size) {
final OctetSequenceJsonWebKey octetKey = OctJwkGenerator.generateJwk(size);
final Map<String, Object> params = octetKey.toParams(JsonWebKey.OutputControlLevel.INCLUDE_SYMMETRIC);
return params.get(JSON_WEB_KEY).toString();
}
use of org.jose4j.jwk.OctetSequenceJsonWebKey in project cas by apereo.
the class BaseBinaryCipherExecutor method generateOctetJsonWebKeyOfSize.
@SneakyThrows
private static String generateOctetJsonWebKeyOfSize(final int size) {
final OctetSequenceJsonWebKey octetKey = OctJwkGenerator.generateJwk(size);
final Map<String, Object> params = octetKey.toParams(JsonWebKey.OutputControlLevel.INCLUDE_SYMMETRIC);
return params.get("k").toString();
}
Aggregations