@Immutable public class JWKMatcher extends Object
Supported key matching criteria:
Matching by JWK thumbprint (RFC 7638), X.509 certificate URL and X.509 certificate chain is not supported.
Modifier and Type | Class and Description |
---|---|
static class |
JWKMatcher.Builder
Builder for constructing JWK matchers.
|
Constructor and Description |
---|
JWKMatcher(Set<KeyType> types,
Set<KeyUse> uses,
Set<KeyOperation> ops,
Set<Algorithm> algs,
Set<String> ids,
boolean privateOnly,
boolean publicOnly)
Deprecated.
|
JWKMatcher(Set<KeyType> types,
Set<KeyUse> uses,
Set<KeyOperation> ops,
Set<Algorithm> algs,
Set<String> ids,
boolean hasUse,
boolean hasID,
boolean privateOnly,
boolean publicOnly,
int minSizeBits,
int maxSizeBits,
Set<Integer> sizesBits,
Set<Curve> curves)
Deprecated.
|
JWKMatcher(Set<KeyType> types,
Set<KeyUse> uses,
Set<KeyOperation> ops,
Set<Algorithm> algs,
Set<String> ids,
boolean hasUse,
boolean hasID,
boolean privateOnly,
boolean publicOnly,
int minSizeBits,
int maxSizeBits,
Set<Integer> sizesBits,
Set<Curve> curves,
Set<Base64URL> x5tS256s)
Creates a new JSON Web Key (JWK) matcher.
|
JWKMatcher(Set<KeyType> types,
Set<KeyUse> uses,
Set<KeyOperation> ops,
Set<Algorithm> algs,
Set<String> ids,
boolean privateOnly,
boolean publicOnly,
int minSizeBits,
int maxSizeBits)
Deprecated.
|
JWKMatcher(Set<KeyType> types,
Set<KeyUse> uses,
Set<KeyOperation> ops,
Set<Algorithm> algs,
Set<String> ids,
boolean privateOnly,
boolean publicOnly,
int minSizeBits,
int maxSizeBits,
Set<Curve> curves)
Deprecated.
|
JWKMatcher(Set<KeyType> types,
Set<KeyUse> uses,
Set<KeyOperation> ops,
Set<Algorithm> algs,
Set<String> ids,
boolean privateOnly,
boolean publicOnly,
int minSizeBits,
int maxSizeBits,
Set<Integer> sizesBits,
Set<Curve> curves)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
Set<Algorithm> |
getAlgorithms()
Returns the JOSE algorithms to match.
|
Set<Curve> |
getCurves()
Returns the curves to match (for EC and OKP keys).
|
Set<String> |
getKeyIDs()
Returns the key IDs to match.
|
Set<KeyOperation> |
getKeyOperations()
Returns the key operations to match.
|
Set<Integer> |
getKeySizes()
Returns the key sizes.
|
Set<KeyType> |
getKeyTypes()
Returns the key types to match.
|
Set<KeyUse> |
getKeyUses()
Returns the public key uses to match.
|
int |
getMaxKeySize()
Returns the maximum key size.
|
int |
getMaxSize()
Deprecated.
|
int |
getMinKeySize()
Returns the minimum key size.
|
int |
getMinSize()
Deprecated.
|
Set<Base64URL> |
getX509CertSHA256Thumbprints()
Returns the X.509 certificate SHA-256 thumbprints to match.
|
boolean |
hasKeyID()
Returns
true if keys with a set use are matched. |
boolean |
hasKeyUse()
Returns
true if keys with a set use are matched. |
boolean |
isPrivateOnly()
Returns
true if only private keys are matched. |
boolean |
isPublicOnly()
Returns
true if only public keys are matched. |
boolean |
matches(JWK key)
Returns
true if the specified JWK matches. |
String |
toString() |
@Deprecated public JWKMatcher(Set<KeyType> types, Set<KeyUse> uses, Set<KeyOperation> ops, Set<Algorithm> algs, Set<String> ids, boolean privateOnly, boolean publicOnly)
types
- The key types to match, null
if not
specified.uses
- The public key uses to match, null
if not
specified.ops
- The key operations to match, null
if not
specified.algs
- The JOSE algorithms to match, null
if not
specified.ids
- The key IDs to match, null
if not
specified.privateOnly
- true
to match a private key.publicOnly
- true
to match a public only key.@Deprecated public JWKMatcher(Set<KeyType> types, Set<KeyUse> uses, Set<KeyOperation> ops, Set<Algorithm> algs, Set<String> ids, boolean privateOnly, boolean publicOnly, int minSizeBits, int maxSizeBits)
types
- The key types to match, null
if not
specified.uses
- The public key uses to match, null
if not
specified.ops
- The key operations to match, null
if not
specified.algs
- The JOSE algorithms to match, null
if not
specified.ids
- The key IDs to match, null
if not
specified.privateOnly
- true
to match a private key.publicOnly
- true
to match a public only key.minSizeBits
- The minimum key size in bits, zero implies no
minimum size limit.maxSizeBits
- The maximum key size in bits, zero implies no
maximum size limit.@Deprecated public JWKMatcher(Set<KeyType> types, Set<KeyUse> uses, Set<KeyOperation> ops, Set<Algorithm> algs, Set<String> ids, boolean privateOnly, boolean publicOnly, int minSizeBits, int maxSizeBits, Set<Curve> curves)
types
- The key types to match, null
if not
specified.uses
- The public key uses to match, null
if not
specified.ops
- The key operations to match, null
if not
specified.algs
- The JOSE algorithms to match, null
if not
specified.ids
- The key IDs to match, null
if not
specified.privateOnly
- true
to match a private key.publicOnly
- true
to match a public only key.minSizeBits
- The minimum key size in bits, zero implies no
minimum size limit.maxSizeBits
- The maximum key size in bits, zero implies no
maximum size limit.curves
- The curves to match (for EC keys), null
if not specified.@Deprecated public JWKMatcher(Set<KeyType> types, Set<KeyUse> uses, Set<KeyOperation> ops, Set<Algorithm> algs, Set<String> ids, boolean privateOnly, boolean publicOnly, int minSizeBits, int maxSizeBits, Set<Integer> sizesBits, Set<Curve> curves)
types
- The key types to match, null
if not
specified.uses
- The public key uses to match, null
if not
specified.ops
- The key operations to match, null
if not
specified.algs
- The JOSE algorithms to match, null
if not
specified.ids
- The key IDs to match, null
if not
specified.privateOnly
- true
to match a private key.publicOnly
- true
to match a public only key.minSizeBits
- The minimum key size in bits, zero implies no
minimum size limit.maxSizeBits
- The maximum key size in bits, zero implies no
maximum size limit.sizesBits
- The key sizes in bits, null
if not
specified.curves
- The curves to match (for EC and OKP keys),
null
if not specified.@Deprecated public JWKMatcher(Set<KeyType> types, Set<KeyUse> uses, Set<KeyOperation> ops, Set<Algorithm> algs, Set<String> ids, boolean hasUse, boolean hasID, boolean privateOnly, boolean publicOnly, int minSizeBits, int maxSizeBits, Set<Integer> sizesBits, Set<Curve> curves)
types
- The key types to match, null
if not
specified.uses
- The public key uses to match, null
if not
specified.ops
- The key operations to match, null
if not
specified.algs
- The JOSE algorithms to match, null
if not
specified.ids
- The key IDs to match, null
if not
specified.hasUse
- true
to match a key with a set use.hasID
- true
to match a key with a set ID.privateOnly
- true
to match a private key.publicOnly
- true
to match a public only key.minSizeBits
- The minimum key size in bits, zero implies no
minimum size limit.maxSizeBits
- The maximum key size in bits, zero implies no
maximum size limit.sizesBits
- The key sizes in bits, null
if not
specified.curves
- The curves to match (for EC and OKP keys),
null
if not specified.public JWKMatcher(Set<KeyType> types, Set<KeyUse> uses, Set<KeyOperation> ops, Set<Algorithm> algs, Set<String> ids, boolean hasUse, boolean hasID, boolean privateOnly, boolean publicOnly, int minSizeBits, int maxSizeBits, Set<Integer> sizesBits, Set<Curve> curves, Set<Base64URL> x5tS256s)
types
- The key types to match, null
if not
specified.uses
- The public key uses to match, null
if not
specified.ops
- The key operations to match, null
if not
specified.algs
- The JOSE algorithms to match, null
if not
specified.ids
- The key IDs to match, null
if not
specified.hasUse
- true
to match a key with a set use.hasID
- true
to match a key with a set ID.privateOnly
- true
to match a private key.publicOnly
- true
to match a public only key.minSizeBits
- The minimum key size in bits, zero implies no
minimum size limit.maxSizeBits
- The maximum key size in bits, zero implies no
maximum size limit.sizesBits
- The key sizes in bits, null
if not
specified.curves
- The curves to match (for EC and OKP keys),
null
if not specified.x5tS256s
- The X.509 certificate thumbprints to match,
null
if not specified.public Set<KeyType> getKeyTypes()
null
if not specified.public Set<KeyUse> getKeyUses()
null
if not specified.public Set<KeyOperation> getKeyOperations()
null
if not specified.public Set<Algorithm> getAlgorithms()
null
if not specified.public Set<String> getKeyIDs()
null
if not specified.public boolean hasKeyUse()
true
if keys with a set use are matched.true
if keys with a set use are matched, else
false
.public boolean hasKeyID()
true
if keys with a set use are matched.true
if keys with a set ID are matched, else
false
.public boolean isPrivateOnly()
true
if only private keys are matched.true
if only private keys are matched, else
false
.public boolean isPublicOnly()
true
if only public keys are matched.true
if only public keys are selected, else
false
.@Deprecated public int getMinSize()
getMinKeySize()
instead.public int getMinKeySize()
@Deprecated public int getMaxSize()
getMaxKeySize()
instead.public int getMaxKeySize()
public Set<Integer> getKeySizes()
null
if not specified.public Set<Curve> getCurves()
null
if not specified.public Set<Base64URL> getX509CertSHA256Thumbprints()
null
if not specified.public boolean matches(JWK key)
true
if the specified JWK matches.key
- The JSON Web Key (JWK). Must not be null
.true
if the JWK matches, else false
.Copyright © 2018 Connect2id Ltd.. All rights reserved.