com.nimbusds.jose.Payload.toBytes()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中com.nimbusds.jose.Payload.toBytes()方法的一些代码示例,展示了Payload.toBytes()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Payload.toBytes()方法的具体详情如下:
包路径:com.nimbusds.jose.Payload
类名称:Payload
方法名:toBytes

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);

相关文章