Package com.nimbusds.jose.jwk
Class JWKMatcher.Builder
java.lang.Object
com.nimbusds.jose.jwk.JWKMatcher.Builder
- Enclosing class:
- JWKMatcher
Builder for constructing JWK matchers.
Example usage:
JWKMatcher matcher = new JWKMatcher().keyID("123").build();
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder()
Creates a new builder for constructing JWK matchers.Builder
(JWKMatcher jwkMatcher) Creates a new builder for constructing JWK matchers using the specified matcher. -
Method Summary
Modifier and TypeMethodDescriptionSets a single JOSE algorithm to match.algorithms
(Algorithm... algs) Sets multiple JOSE algorithms to match.algorithms
(Set<Algorithm> algs) Sets multiple JOSE algorithms to match.build()
Builds a new JWK matcher.Sets a single curve to match (for EC and OKP keys).Sets multiple curves to match (for EC and OKP keys).Sets multiple curves to match (for EC and OKP keys).hasKeyID
(boolean hasID) Deprecated.hasKeyUse
(boolean hasUse) Deprecated.hasX509CertChain
(boolean hasX5C) Deprecated.Sets a single key ID to match.Sets multiple key IDs to match.Sets multiple key IDs to match.Sets a single key operation to match.keyOperations
(KeyOperation... ops) Sets multiple key operations to match.keyOperations
(Set<KeyOperation> ops) Sets multiple key operations to match.keySize
(int keySizeBits) Sets the key size.keySizes
(int... keySizesBits) Sets the key sizes.Sets the key sizes.Sets a single key type to match.Sets multiple key types to match.Sets multiple key types to match.Sets a single public key use to match.Sets multiple public key uses to match.Sets multiple public key uses to match.maxKeySize
(int maxSizeBits) Sets the maximum key size.minKeySize
(int minSizeBits) Sets the minimal key size.nonRevokedOnly
(boolean nonRevokedOnly) Sets the non-revoked key matching.privateOnly
(boolean privateOnly) Sets the private key matching.publicOnly
(boolean publicOnly) Sets the public key matching.revokedOnly
(boolean revokedOnly) Sets the revoked key matching.withKeyIDOnly
(boolean withIDOnly) Sets the key ID presence matching.withKeyUseOnly
(boolean withUseOnly) Sets the key use presence matching.withX509CertChainOnly
(boolean withX5CONly) Sets the X.509 certificate chain presence matching.x509CertSHA256Thumbprint
(Base64URL x5tS256) Sets a single X.509 certificate SHA-256 thumbprint to match.x509CertSHA256Thumbprints
(Base64URL... x5tS256s) Sets multiple X.509 certificate SHA-256 thumbprints to match.x509CertSHA256Thumbprints
(Set<Base64URL> x5tS256s) Sets multiple X.509 certificate SHA-256 thumbprints to match.
-
Constructor Details
-
Builder
public Builder()Creates a new builder for constructing JWK matchers. -
Builder
Creates a new builder for constructing JWK matchers using the specified matcher.- Parameters:
jwkMatcher
- The JWK matcher to use. Must not benull
.
-
-
Method Details
-
keyType
Sets a single key type to match.- Parameters:
kty
- The key type,null
if not specified.- Returns:
- This builder.
-
keyTypes
Sets multiple key types to match.- Parameters:
types
- The key types.- Returns:
- This builder.
-
keyTypes
Sets multiple key types to match.- Parameters:
types
- The key types,null
if not specified.- Returns:
- This builder.
-
keyUse
Sets a single public key use to match.- Parameters:
use
- The public key use,null
if not specified.- Returns:
- This builder.
-
keyUses
Sets multiple public key uses to match.- Parameters:
uses
- The public key uses.- Returns:
- This builder.
-
keyUses
Sets multiple public key uses to match.- Parameters:
uses
- The public key uses,null
if not specified.- Returns:
- This builder.
-
keyOperation
Sets a single key operation to match.- Parameters:
op
- The key operation,null
if not specified.- Returns:
- This builder.
-
keyOperations
Sets multiple key operations to match.- Parameters:
ops
- The key operations.- Returns:
- This builder.
-
keyOperations
Sets multiple key operations to match.- Parameters:
ops
- The key operations,null
if not specified.- Returns:
- This builder.
-
algorithm
Sets a single JOSE algorithm to match.- Parameters:
alg
- The JOSE algorithm,null
if not specified.- Returns:
- This builder.
-
algorithms
Sets multiple JOSE algorithms to match.- Parameters:
algs
- The JOSE algorithms.- Returns:
- This builder.
-
algorithms
Sets multiple JOSE algorithms to match.- Parameters:
algs
- The JOSE algorithms,null
if not specified.- Returns:
- This builder.
-
keyID
Sets a single key ID to match.- Parameters:
id
- The key ID,null
if not specified.- Returns:
- This builder.
-
keyIDs
Sets multiple key IDs to match.- Parameters:
ids
- The key IDs.- Returns:
- This builder.
-
keyIDs
Sets multiple key IDs to match.- Parameters:
ids
- The key IDs,null
if not specified.- Returns:
- This builder.
-
hasKeyUse
Deprecated.Sets the key use presence matching.- Parameters:
hasUse
-true
to match a key with a specified use only.- Returns:
- This builder.
-
withKeyUseOnly
Sets the key use presence matching.- Parameters:
withUseOnly
-true
to match a key with a specified use only.- Returns:
- This builder.
-
hasKeyID
Deprecated.Sets the key ID presence matching.- Parameters:
hasID
-true
to match a key a specified ID only.- Returns:
- This builder.
-
withKeyIDOnly
Sets the key ID presence matching.- Parameters:
withIDOnly
-true
to match a key a specified ID only.- Returns:
- This builder.
-
privateOnly
Sets the private key matching.- Parameters:
privateOnly
-true
to match a private key only.- Returns:
- This builder.
-
publicOnly
Sets the public key matching.- Parameters:
publicOnly
-true
to match a public key only.- Returns:
- This builder.
-
nonRevokedOnly
Sets the non-revoked key matching.- Parameters:
nonRevokedOnly
-true
to match a non-revoked key only.- Returns:
- This builder.
-
revokedOnly
Sets the revoked key matching.- Parameters:
revokedOnly
-true
to match a revoked key only.- Returns:
- This builder.
-
minKeySize
Sets the minimal key size.- Parameters:
minSizeBits
- The minimum key size in bits, zero implies no minimum key size limit.- Returns:
- This builder.
-
maxKeySize
Sets the maximum key size.- Parameters:
maxSizeBits
- The maximum key size in bits, zero implies no maximum key size limit.- Returns:
- This builder.
-
keySize
Sets the key size.- Parameters:
keySizeBits
- The key size in bits, zero if not specified.- Returns:
- This builder.
-
keySizes
Sets the key sizes.- Parameters:
keySizesBits
- The key sizes in bits.- Returns:
- This builder.
-
keySizes
Sets the key sizes.- Parameters:
keySizesBits
- The key sizes in bits.- Returns:
- This builder.
-
curve
Sets a single curve to match (for EC and OKP keys).- Parameters:
curve
- The curve,null
if not specified.- Returns:
- This builder.
-
curves
Sets multiple curves to match (for EC and OKP keys).- Parameters:
curves
- The curves.- Returns:
- This builder.
-
curves
Sets multiple curves to match (for EC and OKP keys).- Parameters:
curves
- The curves,null
if not specified.- Returns:
- This builder.
-
x509CertSHA256Thumbprint
Sets a single X.509 certificate SHA-256 thumbprint to match.- Parameters:
x5tS256
- The thumbprint,null
if not specified.- Returns:
- This builder.
-
x509CertSHA256Thumbprints
Sets multiple X.509 certificate SHA-256 thumbprints to match.- Parameters:
x5tS256s
- The thumbprints.- Returns:
- This builder.
-
x509CertSHA256Thumbprints
Sets multiple X.509 certificate SHA-256 thumbprints to match.- Parameters:
x5tS256s
- The thumbprints,null
if not specified.- Returns:
- This builder.
-
hasX509CertChain
Deprecated.Sets the X.509 certificate chain presence matching.- Parameters:
hasX5C
-true
to match a key with a specified X.509 certificate chain only.- Returns:
- This builder.
-
withX509CertChainOnly
Sets the X.509 certificate chain presence matching.- Parameters:
withX5CONly
-true
to match a key with a specified X.509 certificate chain only.- Returns:
- This builder.
-
build
Builds a new JWK matcher.- Returns:
- The JWK matcher.
-