public class

PKCS7SignatureContents

extends Object
implements SignatureContents
java.lang.Object
   ↳ com.pspdfkit.signatures.contents.PKCS7SignatureContents

Class Overview

Implementation of SignatureContents that returns PKCS7 container.

Summary

Public Constructors
PKCS7SignatureContents(byte[] digest, KeyStore.PrivateKeyEntry privateKey, HashAlgorithm hashAlgorithm, FilterSubtype filterSubtype)
Creates an instance of signature contents that serves binary data of PKCS7 cryptographic container.
PKCS7SignatureContents(SignatureFormField signatureFormField, KeyStore.PrivateKeyEntry signingKey, HashAlgorithm hashAlgorithm, FilterSubtype filterSubtype)
Creates an instance of signature contents that serves binary data of PKCS7 cryptographic container.
PKCS7SignatureContents(byte[] digest, KeyStore.PrivateKeyEntry privateKey, HashAlgorithm hashAlgorithm)
This constructor is deprecated. Please use PKCS7SignatureContents(byte[], KeyStore.PrivateKeyEntry, HashAlgorithm, FilterSubtype) instead, which replaces this method.
PKCS7SignatureContents(SignatureFormField signatureFormField, KeyStore.PrivateKeyEntry signingKey, HashAlgorithm hashAlgorithm)
This constructor is deprecated. Please use PKCS7SignatureContents(SignatureFormField, KeyStore.PrivateKeyEntry, HashAlgorithm, FilterSubtype) instead, which replaces this method.
Public Methods
byte[] signData(byte[] dataToSign)
Given some dataToSign, return the digital signature contents that will be placed in the PDF document.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pspdfkit.signatures.contents.SignatureContents

Public Constructors

public PKCS7SignatureContents (byte[] digest, KeyStore.PrivateKeyEntry privateKey, HashAlgorithm hashAlgorithm, FilterSubtype filterSubtype)

Creates an instance of signature contents that serves binary data of PKCS7 cryptographic container.

Parameters
digest The digest data that will be cryptographically protected by the PKCS7. For digital signatures this is typically hash of the PDF document except the signature contents.
privateKey The private key that will be used to encrypt the digest.
hashAlgorithm The hash algorithm that was used to hash the digest argument.
filterSubtype Filter subtype for encoding or format that will be used to create the signature.

public PKCS7SignatureContents (SignatureFormField signatureFormField, KeyStore.PrivateKeyEntry signingKey, HashAlgorithm hashAlgorithm, FilterSubtype filterSubtype)

Creates an instance of signature contents that serves binary data of PKCS7 cryptographic container.

Parameters
signatureFormField Signature form field to be signed.
signingKey The private key that will be used to encrypt the digest.
hashAlgorithm The hash algorithm that was used to hash the digest argument.
filterSubtype Filter subtype for encoding or format that will be used to create the signature.

public PKCS7SignatureContents (byte[] digest, KeyStore.PrivateKeyEntry privateKey, HashAlgorithm hashAlgorithm)

This constructor is deprecated.
Please use PKCS7SignatureContents(byte[], KeyStore.PrivateKeyEntry, HashAlgorithm, FilterSubtype) instead, which replaces this method.

Creates an instance of signature contents that serves binary data of PKCS7 cryptographic container with a filter subtype set to ADOBE_PKCS7_DETACHED.

Parameters
digest The digest data that will be cryptographically protected by the PKCS7. For digital signatures this is typically hash of the PDF document except the signature contents.
privateKey The private key that will be used to encrypt the digest.
hashAlgorithm The hash algorithm that was used to hash the digest argument.

public PKCS7SignatureContents (SignatureFormField signatureFormField, KeyStore.PrivateKeyEntry signingKey, HashAlgorithm hashAlgorithm)

This constructor is deprecated.
Please use PKCS7SignatureContents(SignatureFormField, KeyStore.PrivateKeyEntry, HashAlgorithm, FilterSubtype) instead, which replaces this method.

Creates an instance of signature contents that serves binary data of PKCS7 cryptographic container with a filter subtype set to ADOBE_PKCS7_DETACHED.

Parameters
signatureFormField Signature form field to be signed.
signingKey The private key that will be used to encrypt the digest.
hashAlgorithm The hash algorithm that was used to hash the digest argument.

Public Methods

public byte[] signData (byte[] dataToSign)

Given some dataToSign, return the digital signature contents that will be placed in the PDF document.

Parameters
dataToSign The raw range of the PDF document that should be covered by the signature. In a specific implementation, you may hash the data, encrypt it, and then return it serialized in PKCS#7 format (https://tools.ietf.org/html/rfc2315).