本文整理了Java中com.nimbusds.jose.Payload.toBytes()
方法的一些代码示例,展示了Payload.toBytes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Payload.toBytes()
方法的具体详情如下:
包路径:com.nimbusds.jose.Payload
类名称:Payload
方法名:toBytes
[英]Returns a byte array representation of this payload.
[中]返回此有效负载的字节数组表示形式。
代码示例来源:origin: com.nimbusds/nimbus-jose-jwt
/**
* Returns a Base64URL representation of this payload.
*
* @return The Base64URL representation.
*/
public Base64URL toBase64URL() {
if (base64URL != null) {
return base64URL;
}
// Convert
return Base64URL.encode(toBytes());
}
代码示例来源:origin: de.adorsys.psd2/consent-management-lib
@Override
public Optional<DecryptedData> decryptData(byte[] data, String password) {
try {
SecretKey key = getSecretKey(password);
JWEObject jweObject = JWEObject.parse(new String(data));
JWEDecrypter decrypter = new AESDecrypter(key.getEncoded());
jweObject.decrypt(decrypter);
return Optional.of(new DecryptedData(jweObject.getPayload().toBytes()));
} catch (Exception e) {
log.error("Error encryption data. Data can't be parsed : {}", e);
}
return Optional.empty();
}
代码示例来源:origin: adorsys/xs2a
@Override
public Optional<DecryptedData> decryptData(byte[] data, String password) {
try {
SecretKey key = getSecretKey(password);
JWEObject jweObject = JWEObject.parse(new String(data));
JWEDecrypter decrypter = new AESDecrypter(key.getEncoded());
jweObject.decrypt(decrypter);
return Optional.of(new DecryptedData(jweObject.getPayload().toBytes()));
} catch (Exception e) {
log.error("Error encryption data. Data can't be parsed : {}", e);
}
return Optional.empty();
}
代码示例来源:origin: de.adorsys.cryptoutils/encobject-jcloud
throw new WrongKeyCredentialException(e);
return jweObject.getPayload().toBytes();
代码示例来源:origin: com.nimbusds/nimbus-jose-jwt
parts = encrypter.encrypt(getHeader(), getPayload().toBytes());
代码示例来源:origin: de.adorsys.cryptoutils/encobject
return jweObject.getPayload().toBytes();
} catch (Exception e) {
throw BaseExceptionHandler.handle(e);
内容来源于网络,如有侵权,请联系作者删除!