Package org.pgpainless.key.generation.type

# Interface KeyType

All Known Implementing Classes:
  `ECDH`, `ECDSA`, `EdDSA`, `ElGamal`, `RSA`, `XDH`

public interface KeyType

## Method Summary

Modifier and Type
Method
Description
`default boolean`
`canAuthenticate()`
Return true if the key that is generated from this type is able to carry the AUTHENTICATION key flag.
`default boolean`
`canCertify()`
Return true if the key that is generated from this type is able to carry the CERTIFY_OTHER key flag.
`default boolean`
`canEncryptCommunication()`
Return true if the key that is generated from this type is able to carry the ENCRYPT_COMMS key flag.
`default boolean`
`canEncryptStorage()`
Return true if the key that is generated from this type is able to carry the ENCRYPT_STORAGE key flag.
`default boolean`
`canSign()`
Return true if the key that is generated from this type is able to carry the SIGN_DATA key flag.
`static KeyType`
`ECDH(EllipticCurve curve)`
`static KeyType`
`ECDSA(EllipticCurve curve)`
`static KeyType`
`EDDSA(EdDSACurve curve)`
`PublicKeyAlgorithm`
`getAlgorithm()`
Return the public key algorithm.
`AlgorithmParameterSpec`
`getAlgorithmSpec()`
Return an implementation of `AlgorithmParameterSpec` that can be used to generate the key.
`int`
`getBitStrength()`
Return the strength of the key in bits.
`String`
`getName()`
Return the encryption algorithm name.
`static KeyType`
`RSA(RsaLength length)`
`static KeyType`
`XDH(XDHSpec curve)`

## Method Details

### getName

String getName()
Return the encryption algorithm name.

Returns:
  algorithm name.

### getAlgorithm

PublicKeyAlgorithm getAlgorithm()
Return the public key algorithm.

Returns:
  public key algorithm

### getBitStrength

int getBitStrength()
Return the strength of the key in bits.

Returns:
  strength of the key in bits

### getAlgorithmSpec

AlgorithmParameterSpec getAlgorithmSpec()
Return an implementation of `AlgorithmParameterSpec` that can be used to generate the key.

Returns:
  algorithm parameter spec

### canSign

default boolean canSign()
Return true if the key that is generated from this type is able to carry the SIGN_DATA key flag. See `KeyFlag.SIGN_DATA`.

Returns:
  true if the key can sign.

### canCertify

default boolean canCertify()
Return true if the key that is generated from this type is able to carry the CERTIFY_OTHER key flag. See `KeyFlag.CERTIFY_OTHER`.

Returns:
  true if the key is able to certify other keys

### canAuthenticate

default boolean canAuthenticate()
Return true if the key that is generated from this type is able to carry the AUTHENTICATION key flag. See `KeyFlag.AUTHENTICATION`.

Returns:
  true if the key can be used for authentication purposes.

### canEncryptCommunication

default boolean canEncryptCommunication()
Return true if the key that is generated from this type is able to carry the ENCRYPT_COMMS key flag. See `KeyFlag.ENCRYPT_COMMS`.

Returns:
  true if the key can encrypt communication

### canEncryptStorage

default boolean canEncryptStorage()
Return true if the key that is generated from this type is able to carry the ENCRYPT_STORAGE key flag. See `KeyFlag.ENCRYPT_STORAGE`.

Returns:
  true if the key can encrypt for storage

### RSA

static KeyType RSA(RsaLength length)

### ECDH

static KeyType ECDH(EllipticCurve curve)

### ECDSA

static KeyType ECDSA(EllipticCurve curve)

### EDDSA

static KeyType EDDSA(EdDSACurve curve)

### XDH

static KeyType XDH(XDHSpec curve)