com.jscape.util.keystore

## Class KeyPairRecord

- java.lang.Object
- - com.jscape.util.keystore.KeyPairRecord

-     public class KeyPairRecord
      extends java.lang.Object

  Represents a key pair (public and private key).

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `KeyPairRecord()`
    `KeyPairRecord(java.security.KeyPair keyPair)` Creates new instance.
    `KeyPairRecord(java.security.KeyPair keyPair, java.security.cert.Certificate... certificates)` Creates new instance with current creation date.
    `KeyPairRecord(java.security.KeyPair keyPair, java.security.cert.Certificate[] certificates, java.util.Date creationDate)` Creates new instance.
    `KeyPairRecord(java.security.PrivateKey privateKey, java.security.cert.Certificate... certificates)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.jscape.util.keystore.CertifiedKeyPair` | `asCertifiedKeyPair()`
    `java.security.cert.X509Certificate` | `certificate()`
    `java.security.cert.Certificate[]` | `getCertificates()` Gets certificates.
    `java.util.Date` | `getCreationDate()` Gets creation date.
    `java.security.KeyPair` | `getKeyPair()` Gets key pair.
    `java.security.PrivateKey` | `getPrivate()` Gets private key.
    `java.security.PublicKey` | `getPublic()` Gets public key.
    `void` | `setCertificates(java.security.cert.Certificate[] value)` Sets certificates.
    `void` | `setCreationDate(java.util.Date value)` Sets creation date.
    `void` | `setKeyPair(java.security.KeyPair value)`
    `java.lang.String` | `toString()`

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

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### KeyPairRecord

          public KeyPairRecord(java.security.KeyPair keyPair,
                               java.security.cert.Certificate[] certificates,
                               java.util.Date creationDate)

      Creates new instance.
      Parameters:
        `keyPair` - a key pair
        `certificates` - certificates
        `creationDate` - record creation date

    - #### KeyPairRecord

          public KeyPairRecord(java.security.KeyPair keyPair,
                               java.security.cert.Certificate... certificates)

      Creates new instance with current creation date.
      Parameters:
        `keyPair` - a key pair
        `certificates` - certificates

    - #### KeyPairRecord

          public KeyPairRecord(java.security.KeyPair keyPair)

      Creates new instance.
      Parameters:
        `keyPair` - a key pair

    - #### KeyPairRecord

          public KeyPairRecord(java.security.PrivateKey privateKey,
                               java.security.cert.Certificate... certificates)

    - #### KeyPairRecord

          public KeyPairRecord()

  - ### Method Detail

    - #### getKeyPair

          public java.security.KeyPair getKeyPair()

      Gets key pair.
      Returns:
        key pair

    - #### setKeyPair

          public void setKeyPair(java.security.KeyPair value)

    - #### getCertificates

          public java.security.cert.Certificate[] getCertificates()

      Gets certificates.
      Returns:
        certificates

    - #### setCertificates

          public void setCertificates(java.security.cert.Certificate[] value)

      Sets certificates.
      Parameters:
        `value` - new certificates

    - #### getCreationDate

          public java.util.Date getCreationDate()

      Gets creation date.
      Returns:
        record creation date

    - #### setCreationDate

          public void setCreationDate(java.util.Date value)

      Sets creation date.
      Parameters:
        `value` - new creation date

    - #### getPublic

          public java.security.PublicKey getPublic()

      Gets public key.
      Returns:
        a public key

    - #### getPrivate

          public java.security.PrivateKey getPrivate()

      Gets private key.
      Returns:
        a private key

    - #### certificate

          public java.security.cert.X509Certificate certificate()

    - #### asCertifiedKeyPair

          public com.jscape.util.keystore.CertifiedKeyPair asCertifiedKeyPair()

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © JSCAPE LLC. 1999-2020. All Rights Reserved