How can i create same key?

Issue #75 resolved
Former user created an issue

I need to create only one rsaJsonWebKey for all tokens. How should i do this using Java?

Comments (2)

  1. Brian Campbell repo owner
            RsaJsonWebKey rsaJsonWebKey = RsaJwkGenerator.generateJwk(2048);
    
            PrivateKey privateKey = rsaJsonWebKey.getPrivateKey();
            PublicKey publicKey = rsaJsonWebKey.getPublicKey();
            String jwkJson = rsaJsonWebKey.toJson(JsonWebKey.OutputControlLevel.PUBLIC_ONLY);
    
            // ... 
    

    And use that private key to sign.

  2. Log in to comment