Examples of RsaSigner


Examples of org.springframework.security.jwt.crypto.sign.RsaSigner

  }
 
  public void setKeyPair(KeyPair keyPair) {
    PrivateKey privateKey = keyPair.getPrivate();
    Assert.state(privateKey instanceof RSAPrivateKey, "KeyPair must be an RSA ");
    signer = new RsaSigner((RSAPrivateKey) privateKey);
    RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();
    verifier = new RsaVerifier(publicKey);
    verifierKey = "-----BEGIN PUBLIC KEY-----\n" + new String(Base64.encode(publicKey.getEncoded())) + "\n-----END PUBLIC KEY-----";
  }
View Full Code Here

Examples of org.springframework.security.jwt.crypto.sign.RsaSigner

    key = key.trim();

    this.signingKey = key;

    if (isPublic(key)) {
      signer = new RsaSigner(key);
      logger.info("Configured with RSA signing key");
    }
    else {
      // Assume it's a MAC key
      this.verifierKey = key;
View Full Code Here

Examples of org.springframework.security.jwt.crypto.sign.RsaSigner

   * @param key the signature verification key (typically an RSA public key)
   */
  public void setVerifierKey(String key) {
    this.verifierKey = key;
    try {
      new RsaSigner(verifierKey);
      throw new IllegalArgumentException("Private key cannot be set as verifierKey property");
    }
    catch (Exception expected) {
      // Expected
    }
View Full Code Here

Examples of org.springframework.security.jwt.crypto.sign.RsaSigner

    JwtHelper.decodeAndVerify(JOE_RSA_TOKEN, new RsaVerifier(N, D));
  }

  @Test
  public void rsaVerificationIsInverseOfSigning() {
    Jwt jwt = JwtHelper.encode(JOE_CLAIM_SEGMENT, new RsaSigner(N, E));
    jwt.verifySignature(new RsaVerifier(N, D));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.