IPWorks Encrypt 2020 Kotlin Edition

Questions / Feedback?

Key Type

The OpenPGP key being used.

Remarks

This type describes the current key. The key may be a public or secret key. The fields are used to identify or select the key.

Fields

Curve
String?

This field specifies the elliptic curve used in the ECDSA or EdDSA key. This field is only applicable if PublicKeyAlgorithm is ECDSA or EdDSA. Possible values are:

ValuePublicKeyAlgorithmDescription
secp256r1 ECDSA NIST curve P-256
secp384r1 ECDSA NIST curve P-384
secp521r1 ECDSA NIST curve P-521
Ed25519 EdDSA Ed25519
secp256k1 EdDSA Secp256k1

EffectiveDate
String?

The date when this key becomes valid. Prior to this it is not valid. The following is an example of a valid encoded date:

23-Jan-2000 15:00:00.

Encoded
String

The key. This field is used to assign a specific key. The UserId fields may also be used to specify a key.

EncodedB
ByteArray?

The key. This field is used to assign a specific key. The UserId fields may also be used to specify a key.

ExpirationDate
String?

The date the key expires. After this date the key will no longer be valid. The following is an example of a valid encoded date:

23-Jan-2001 15:00:00.

Fingerprint
String?

The hex-encoded, 20-byte fingerprint of the key.

This is in the form:

5E70662EA810E768391A2FE8F7B7D49C89C9D7B1

Id
String?

The hex-encoded, 4-byte key Id. It is same as last 4 bytes of Fingerprint.

This is in the form:

89C9D7B1
The KeyIdLength setting may be set to a value of 8 to return the last 8 bytes instead of the last 4 bytes.

OtherUserIds
String?

If the specified key has alternate user Ids associated with it, this field returns a comma-separated list of the other user Ids.

Passphrase
String?

The passphrase for the key's secret key (if any). This must be specified before operations requiring the secret key are attempted. The passphrase may be supplied in this field or through the KeyPassphrase event, which will fire when a passphrase is required.

The passphrase is required when using the following methods in KeyMgr:

  • AddUserId
  • SignUserId
  • ChangeExpirationDate
  • ChangePassphrase

When using the OpenPGP component, or an email-based component, the following methods require a passphrase for the key:

  • Decrypt
  • Sign
  • SignAndEncrypt

PublicKey
String?

The public key of the key. The key is provided as ASCII armored data.

PublicKeyAlgorithm
String?

A text description of the public key algorithm of the key. Possible values are:

  • RSA
  • DSA
  • ECDSA
  • EdDSA
  • RSA-Legacy

PublicKeyLength
Int

The length of the public key in bits. Common values are 512, 1024, and 2048.

If the PublicKeyAlgorithm field is ECDSA or EcDSA the length of the public key is determined by the Curve. Possible lenghts are:

CurvePublic Key Length (bits)
secp256r1256
secp384r1384
secp521r1521
Ed25519 256
secp256k1256

Revoked
Boolean

Whether or not the key is revoked.

SecretKey
String?

The secret key of the key (if available). The key is provided as ASCII armored data.

SecretKeyAvailable
Boolean

Whether or not a secret key is available for the selected key.

Usage
String?

A text description of UsageFlags.

The value will be of one or more of the following strings, separated by commas:

  • Certifying Other Certificates
  • Signing Emails and Files
  • Encrypting Emails and Files
  • Split Key
  • Authenticate Against Servers
  • Group Key

UsageFlags
Int

Flags that show the intended use for the key. The default value is 0x0F. The value of UsageFlags is a combination of the following flags:

0x01This key may be used to certify other keys.
0x02This key may be used to sign data.
0x0CThis key may be used to encrypt communications and encrypt storage.
0x10The private component of this key may have been split by a secret-sharing mechanism.
0x20This key may be used for authentication.
0x80The private component of this key may be in the possession of more than one person.

Please refer to the Usage field for a text representation of UsageFlags.

UserId
String?

The user Id of the key. When a key is loaded this field is populated with the user Id associated with the key. This field may be set to load a key from the Keyring. When this field is set the component will search the Keyring for a key associated with the UserId specified.

When loading a key with multiple user Ids, this field will be populated with the UserId that was most recently added to the key. To discover all of the UserIds associated with a key query this field and OtherUserIds after loading the key.

The UserId format is:

FirstName LastName (Comment) <Email>
Not all values are required when selecting or generating a key, but at least FirstName or Email are required.

When using this field to select a key you may also specify the key's Id, or any of its subkeys' Ids, instead of a user Id. The component will then search for a key with a matching Id. This is helpful in situations where you do not have the UserId but still need to load the key, such as within the OpenPGP component's RecipientInfo event.

Constructors

public constructor(keyPath: String?)

Reads the OpenPGP public key from the specified KeyPath . If multiple keys are present only the first one is used.

public constructor(keyData: ByteArray?)

Reads the OpenPGP key from the specified KeyData . Both binary-formatted and ASCII-armored data are accepted.

public constructor(keyPath: String?, userId: String?)

Searches the KeyPath for an OpenPGP key with a matching UserId . If UserId is set to "*" the first key will be used.

public constructor(keyPath: String?, secretKeyringFile: String?, publicKeyringFile: String?, userId: String?)

Searches the KeyPath for the specified SecretKeyRingFile and PublicKeyringFile . If UserId is set to "*" the first key will be used.

public constructor(keyData: ByteArray?, userId: String?)

Searches the KeyData for an OpenPGP key with a matching UserId . If UserId is set to "*" the first key will be used.

Copyright (c) 2021 /n software inc. - All rights reserved.
IPWorks Encrypt 2020 Kotlin Edition - Version 20.0 [Build 7941]