- All Implemented Interfaces:
WebCertificateReference,WebKey,WebKeyReference
JSON Web Key (JWK) implementation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface edu.iu.crypt.WebCertificateReference
WebCertificateReference.Builder<B extends WebCertificateReference.Builder<B>>Nested classes/interfaces inherited from interface edu.iu.crypt.WebKey
WebKey.Algorithm, WebKey.Builder<B extends WebKey.Builder<B>>, WebKey.Operation, WebKey.Type, WebKey.UseNested classes/interfaces inherited from interface edu.iu.crypt.WebKeyReference
WebKeyReference.Builder<B extends WebKeyReference.Builder<B>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonObjectSerializesWebKeys as a JSON Web Key Set.booleanbyte[]getKey()Gets the raw key data for use whenWebKey.Type.RAW.getOps()Gets the key operations.Gets the JCE private key implementation.Gets the JCE public key implementation.getType()Gets the key type.getUse()Gets the public key use.inthashCode()parseJwks(JsonObject jwks) Parses a JSON Web Key Set (JWKS).readJwks(InputStream in) Reads a key set from an input stream.Gets key set by URI.(package private) booleanrepresents(Jwk key) Determines whether or not the known components of this key match the known components of another key.serializeTo(JsonObjectBuilder jwkBuilder) Adds serialized JWK attributes to a JSON object builder.toString()Returns a copy of this key for whichWebKey.getPrivateKey()andWebKey.getKey()always return null, and for which the source data backing these methods is not populated.static voidwriteJwks(Iterable<? extends WebKey> webKeys, OutputStream out) WritesWebKeyas a JSON Web Key.Methods inherited from class iu.crypt.JsonKeyReference
getAlgorithm, getKeyIdMethods inherited from class iu.crypt.JsonCertificateReference
getCertificateChain, getCertificateSha256Thumbprint, getCertificateThumbprint, getCertificateUri, verifiedCertificateChainMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface edu.iu.crypt.WebCertificateReference
getCertificateChain, getCertificateSha256Thumbprint, getCertificateThumbprint, getCertificateUriMethods inherited from interface edu.iu.crypt.WebKeyReference
getAlgorithm, getKeyId
-
Constructor Details
-
Jwk
Constructor.- Parameters:
jwk- parsed JWK parameters
-
-
Method Details
-
readJwks
Gets key set by URI.- Parameters:
uri- Key set URI- Returns:
- key set
-
readJwks
Reads a key set from an input stream.- Parameters:
in- input stream- Returns:
WebKey
-
parseJwks
Parses a JSON Web Key Set (JWKS).- Parameters:
jwks- serialized JWKS- Returns:
- parsed key set
-
asJwks
SerializesWebKeys as a JSON Web Key Set.- Parameters:
webKeys-WebKeys- Returns:
- serialized JWKS
-
writeJwks
WritesWebKeyas a JSON Web Key.- Parameters:
webKeys-WebKeysout-OutputStream
-
getType
Description copied from interface:WebKeyGets the key type. -
getUse
Description copied from interface:WebKeyGets the public key use. -
getKey
public byte[] getKey()Description copied from interface:WebKeyGets the raw key data for use whenWebKey.Type.RAW. -
getPublicKey
Description copied from interface:WebKeyGets the JCE public key implementation.- Specified by:
getPublicKeyin interfaceWebKey- Returns:
PublicKey
-
getPrivateKey
Description copied from interface:WebKeyGets the JCE private key implementation.- Specified by:
getPrivateKeyin interfaceWebKey- Returns:
PrivateKey
-
getOps
Description copied from interface:WebKeyGets the key operations. -
wellKnown
Description copied from interface:WebKeyReturns a copy of this key for whichWebKey.getPrivateKey()andWebKey.getKey()always return null, and for which the source data backing these methods is not populated.If these methods would already return null, this key is returned as-is.
-
hashCode
public int hashCode()- Overrides:
hashCodein classJsonKeyReference<Jwk>
-
equals
- Overrides:
equalsin classJsonKeyReference<Jwk>
-
toString
- Overrides:
toStringin classJsonCertificateReference<Jwk>
-
serializeTo
Adds serialized JWK attributes to a JSON object builder.- Overrides:
serializeToin classJsonKeyReference<Jwk>- Parameters:
jwkBuilder-JsonObjectBuilder- Returns:
- jwkBuilder
-
represents
Determines whether or not the known components of this key match the known components of another key.- Overrides:
representsin classJsonKeyReference<Jwk>- Parameters:
key-WebKey- Returns:
- true if all non-null components of both keys match
-