com.nimbusds.jose.jwk.JWK.isPrivate()方法的使用及代码示例

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

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

JWK.isPrivate介绍

[英]Returns true if this JWK contains private or sensitive (non-public) parameters.
[中]如果此JWK包含私有或敏感(非公共)参数,则返回true。

代码示例

代码示例来源:origin: mitreid-connect/OpenID-Connect-Java-Spring-Server

if (jwk.isPrivate()) { // only add the signer if there's a private key
  RSASSASigner signer = new RSASSASigner((RSAKey) jwk);
  signers.put(id, signer);
if (jwk.isPrivate()) {
  ECDSASigner signer = new ECDSASigner((ECKey) jwk);
  signers.put(id, signer);
if (jwk.isPrivate()) { // technically redundant check because all HMAC keys are private
  MACSigner signer = new MACSigner((OctetSequenceKey) jwk);
  signers.put(id, signer);

代码示例来源:origin: mitreid-connect/OpenID-Connect-Java-Spring-Server

encrypters.put(id, encrypter);
if (jwk.isPrivate()) { // we can decrypt!
  RSADecrypter decrypter = new RSADecrypter((RSAKey) jwk);
  decrypter.getJCAContext().setProvider(BouncyCastleProviderSingleton.getInstance());
encrypters.put(id, encrypter);
if (jwk.isPrivate()) { // we can decrypt too
  ECDHDecrypter decrypter = new ECDHDecrypter((ECKey) jwk);
  decrypter.getJCAContext().setProvider(BouncyCastleProviderSingleton.getInstance());

代码示例来源:origin: com.nimbusds/nimbus-jose-jwt

/**
 * Builder for constructing JSON Web Encryption (JWE) headers.
 *
 * <p>Example usage:
 *
 * <pre>
 * JWEHeader header = new JWEHeader.Builder(JWEAlgorithm.RSA1_5, EncryptionMethod.A128GCM).
 *                    contentType("text/plain").
 *                    customParam("exp", new Date().getTime()).
 *                    build();
 * </pre>
 */
public static class Builder {
  /**
   * The JWE algorithm.
   */
  private final JWEAlgorithm alg;
  /**
   * The encryption method.
   */
  private final EncryptionMethod enc;
  /**
   * The JOSE object type.
   */

代码示例来源:origin: com.nimbusds/nimbus-jose-jwt

return false;
if (privateOnly && ! key.isPrivate())
  return false;
if (publicOnly && key.isPrivate())
  return false;

相关文章