Package org.opensaml.xmlsec.keyinfo

# Class KeyInfoCredentialResolutionMode

java.lang.Object
org.opensaml.xmlsec.keyinfo.KeyInfoCredentialResolutionMode

All Implemented Interfaces:
  `Criterion`

public final class KeyInfoCredentialResolutionMode extends Object implements Criterion
An implementation of `Criterion` which specifies criteria to a `KeyInfoCredentialResolver` about whether to resolve public credentials, local credentials, or both.

A local credential is defined as one carrying either a `PrivateKey` or a `SecretKey`.

This criterion is used with resolver implementations which are capable of local credential resolution using the (usually public) information available directly within `KeyInfo`.

If `PUBLIC` then resolver implementations may skip local resolution and return any credentials extracted directly from `KeyInfo`. This mode does not mean that a local credential will absolutely not be returned, merely that the resolver is not obligated to do so. For example, an `AgreementMethod` might produce a credential containing a `SecretKey`, and this would be returned in this mode.

If `LOCAL` then resolver implementations which are capable of resolving local credentials should attempt that local credential resolution, and only those local credentials should be returned.

If `BOTH` then local credential resolution should be attempted as in `LOCAL`. If a local credential based on a given public credential's info is resolved it will be returned, otherwise the public credential itself will be returned.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`KeyInfoCredentialResolutionMode.Mode`
Credential resolution mode.

## Field Summary

Fields
Modifier and Type
Field
Description
`private KeyInfoCredentialResolutionMode.Mode`
`mode`
Resolution mode.

## Constructor Summary

Constructors
Constructor
Description
`KeyInfoCredentialResolutionMode(KeyInfoCredentialResolutionMode.Mode resolutionMode)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
`KeyInfoCredentialResolutionMode.Mode`
`getMode()`
Gets the resolution mode.
`int`
`hashCode()`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### mode

@Nonnull private KeyInfoCredentialResolutionMode.Mode mode
Resolution mode.

## Constructor Details

### KeyInfoCredentialResolutionMode

public KeyInfoCredentialResolutionMode(@Nonnull KeyInfoCredentialResolutionMode.Mode resolutionMode)
Constructor.

Parameters:
  `resolutionMode` - the resolution mode

## Method Details

### getMode

@Nonnull public KeyInfoCredentialResolutionMode.Mode getMode()
Gets the resolution mode.

Returns:
  the resolution mode

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`