本文整理汇总了Java中org.jose4j.jws.AlgorithmIdentifiers.RSA_USING_SHA512属性的典型用法代码示例。如果您正苦于以下问题:Java AlgorithmIdentifiers.RSA_USING_SHA512属性的具体用法?Java AlgorithmIdentifiers.RSA_USING_SHA512怎么用?Java AlgorithmIdentifiers.RSA_USING_SHA512使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.jose4j.jws.AlgorithmIdentifiers
的用法示例。
在下文中一共展示了AlgorithmIdentifiers.RSA_USING_SHA512属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateAccessTokenHash
private String generateAccessTokenHash(final AccessToken accessTokenId,
final OidcRegisteredService service) {
final byte[] tokenBytes = accessTokenId.getId().getBytes();
final String hashAlg;
switch (signingService.getJsonWebKeySigningAlgorithm()) {
case AlgorithmIdentifiers.RSA_USING_SHA512:
hashAlg = MessageDigestAlgorithms.SHA_512;
break;
case AlgorithmIdentifiers.RSA_USING_SHA256:
default:
hashAlg = MessageDigestAlgorithms.SHA_256;
}
LOGGER.debug("Digesting access token hash via algorithm [{}]", hashAlg);
final byte[] digested = DigestUtils.rawDigest(hashAlg, tokenBytes);
final byte[] hashBytesLeftHalf = Arrays.copyOf(digested, digested.length / 2);
return EncodingUtils.encodeBase64(hashBytesLeftHalf);
}
示例2: getAlgorithmIdentifier
private String getAlgorithmIdentifier() {
String algorithmId = AlgorithmIdentifiers.RSA_USING_SHA256;
switch (this.encryptionAlgorithm) {
case RSA_SHA_384:
algorithmId = AlgorithmIdentifiers.RSA_USING_SHA384;
break;
case RSA_SHA_512:
algorithmId = AlgorithmIdentifiers.RSA_USING_SHA512;
break;
case RSA_SHA_256:
default:
break;
}
return algorithmId;
}
示例3: getAlgorithm
@Override
protected String getAlgorithm() {
return AlgorithmIdentifiers.RSA_USING_SHA512;
}