java.lang.Object
org.apache.kerby.kerberos.kerb.preauth.pkinit.PkinitUtil

public class PkinitUtil extends Object
Encapsulates working with PKINIT signed data structures.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte[]
    getSignedAuthPack(PrivateKey privateKey, X509Certificate certificate, org.apache.kerby.kerberos.kerb.type.pa.pkinit.AuthPack authPack)
    Uses a private key to sign data in a CMS SignedData structure and returns the encoded CMS SignedData as bytes.
    static byte[]
    getSignedKdcDhKeyInfo(PrivateKey privateKey, X509Certificate certificate, org.apache.kerby.kerberos.kerb.type.pa.pkinit.KdcDhKeyInfo kdcDhKeyInfo)
    Uses a private key to sign data in a CMS SignedData structure and returns the encoded CMS SignedData as bytes.
    static byte[]
    getSignedReplyKeyPack(PrivateKey privateKey, X509Certificate certificate, org.apache.kerby.kerberos.kerb.type.pa.pkinit.ReplyKeyPack replyKeyPack)
    Uses a private key to sign data in a CMS SignedData structure and returns the encoded CMS SignedData as bytes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PkinitUtil

      public PkinitUtil()
  • Method Details

    • getSignedAuthPack

      public static byte[] getSignedAuthPack(PrivateKey privateKey, X509Certificate certificate, org.apache.kerby.kerberos.kerb.type.pa.pkinit.AuthPack authPack) throws org.apache.kerby.kerberos.kerb.KrbException
      Uses a private key to sign data in a CMS SignedData structure and returns the encoded CMS SignedData as bytes. 'signedAuthPack' contains a CMS type ContentInfo encoded according to [RFC3852]. The contentType field of the type ContentInfo is id-signedData (1.2.840.113549.1.7.2), and the content field is a SignedData. The eContentType field for the type SignedData is id-pkinit-authData (1.3.6.1.5.2.3.1), and the eContent field contains the DER encoding of the type AuthPack.
      Parameters:
      privateKey - The private key
      certificate - The certificate
      authPack - The auth pack
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException - e
    • getSignedKdcDhKeyInfo

      public static byte[] getSignedKdcDhKeyInfo(PrivateKey privateKey, X509Certificate certificate, org.apache.kerby.kerberos.kerb.type.pa.pkinit.KdcDhKeyInfo kdcDhKeyInfo) throws org.apache.kerby.kerberos.kerb.KrbException
      Uses a private key to sign data in a CMS SignedData structure and returns the encoded CMS SignedData as bytes. 'dhSignedData' contains a CMS type ContentInfo encoded according to [RFC3852]. The contentType field of the type ContentInfo is id-signedData (1.2.840.113549.1.7.2), and the content field is a SignedData. The eContentType field for the type SignedData is id-pkinit-DHKeyData (1.3.6.1.5.2.3.2), and the eContent field contains the DER encoding of the type KDCDHKeyInfo.
      Parameters:
      privateKey - The private Key
      certificate - The certificate
      kdcDhKeyInfo - The kdc dh key info
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException - e
    • getSignedReplyKeyPack

      public static byte[] getSignedReplyKeyPack(PrivateKey privateKey, X509Certificate certificate, org.apache.kerby.kerberos.kerb.type.pa.pkinit.ReplyKeyPack replyKeyPack) throws org.apache.kerby.kerberos.kerb.KrbException
      Uses a private key to sign data in a CMS SignedData structure and returns the encoded CMS SignedData as bytes. Selected when public key encryption is used. The eContentType field for the inner type SignedData (when unencrypted) is id-pkinit-rkeyData (1.3.6.1.5.2.3.3) and the eContent field contains the DER encoding of the type ReplyKeyPack.
      Parameters:
      privateKey - The private key
      certificate - The certificate
      replyKeyPack - The reply key pack
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException - e