Class SimpleTokenUtils
java.lang.Object
org.eclipse.microprofile.jwt.tck.config.SimpleTokenUtils
Scaled down version of tck TokenUtils that has no JWT library dependencies so that it can be embedded in the tck wars
without needing a JWT library on the server side.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ECPublicKeydecodeECPublicKey(String pemEncoded) Decode a PEM encoded public key string to an EC PublicKeystatic PrivateKeydecodeJWKSPrivateKey(String jwksValue) Decode a JWK(S) encoded private key string to an RSA PrivateKeystatic RSAPublicKeydecodeJWKSPublicKey(String jwksValue) Decode a JWK(S) encoded public key string to an RSA PublicKeystatic PrivateKeydecodePrivateKey(String pemEncoded) Decode a PEM encoded private key string to an RSA PrivateKeystatic RSAPublicKeydecodePublicKey(String pemEncoded) Decode a PEM encoded public key string to an RSA PublicKeystatic StringreadResource(String resName) Read a classpath resource into a string and return it.
-
Method Details
-
decodePrivateKey
Decode a PEM encoded private key string to an RSA PrivateKey- Parameters:
pemEncoded- - PEM string for private key- Returns:
- PrivateKey
- Throws:
Exception- on decode failure
-
decodePublicKey
Decode a PEM encoded public key string to an RSA PublicKey- Parameters:
pemEncoded- - PEM string for public key- Returns:
- RSAPublicKey
- Throws:
Exception- on decode failure
-
decodeECPublicKey
Decode a PEM encoded public key string to an EC PublicKey- Parameters:
pemEncoded- - PEM string for public key- Returns:
- ECPublicKey
- Throws:
Exception- on decode failure
-
decodeJWKSPublicKey
Decode a JWK(S) encoded public key string to an RSA PublicKey- Parameters:
jwksValue- - JWKS string value- Returns:
- RSAPublicKey from RSAPublicKeySpec
- Throws:
Exception
-
decodeJWKSPrivateKey
Decode a JWK(S) encoded private key string to an RSA PrivateKey- Parameters:
jwksValue- - JWKS string value- Returns:
- PrivateKey from RSAPrivateKeySpec
- Throws:
Exception
-
readResource
Read a classpath resource into a string and return it.- Parameters:
resName- - classpath resource name- Returns:
- the resource content as a string
- Throws:
IOException- - on failure
-