Package org.pgpainless.key.info

# Class KeyAccessor.SubKey

java.lang.Object
org.pgpainless.key.info.KeyAccessor
org.pgpainless.key.info.KeyAccessor.SubKey

Enclosing class:
  `KeyAccessor`

public static class KeyAccessor.SubKey extends KeyAccessor

## Nested Class Summary

## Nested classes/interfaces inherited from class org.pgpainless.key.info.KeyAccessor

`KeyAccessor.SubKey, KeyAccessor.ViaKeyId, KeyAccessor.ViaUserId`

## Field Summary

### Fields inherited from class org.pgpainless.key.info.KeyAccessor

`info, key`

## Constructor Summary

Constructors
Constructor
Description
`SubKey(KeyRingInfo info, SubkeyIdentifier key)`

## Method Summary

Modifier and Type
Method
Description
`org.bouncycastle.openpgp.PGPSignature`
`getSignatureWithPreferences()`
Depending on the way we address the key (key-id or user-id), return the respective `PGPSignature` which contains the algorithm preferences we are going to use.

### Methods inherited from class org.pgpainless.key.info.KeyAccessor

`getPreferredCompressionAlgorithms, getPreferredHashAlgorithms, getPreferredSymmetricKeyAlgorithms`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SubKey

public SubKey(@Nonnull KeyRingInfo info, @Nonnull SubkeyIdentifier key)

## Method Details

### getSignatureWithPreferences

@Nonnull public org.bouncycastle.openpgp.PGPSignature getSignatureWithPreferences()
Description copied from class: `KeyAccessor`
Depending on the way we address the key (key-id or user-id), return the respective `PGPSignature` which contains the algorithm preferences we are going to use.

If we address a key via its user-id, we want to rely on the algorithm preferences in the user-id certification, while we would instead rely on those in the direct-key signature if we'd address the key by key-id.

Specified by:
  `getSignatureWithPreferences` in class `KeyAccessor`
Returns:
  signature