PSPDFPKCS7

Objective-C


@interface PSPDFPKCS7 : NSObject

Swift

class PKCS7 : NSObject

An instance of this class represents a PKCS7 (https://tools.ietf.org/html/rfc2315) cryptographic container. This container format is the most common format used for signing PDFs digitally. For example, you can use an instance of this class when you want to sign a document that was already prepared for deferred digital signing. One example scenario may be the following:

  • Unavailable

    Not the designated initializer

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • Unavailable

    Not the designated initializer

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • Creates an instance of a PKCS7 container.

    Declaration

    Objective-C

    + (nonnull PSPDFPKCS7 *)create:(nonnull NSData *)digest
                        privateKey:(nonnull PSPDFPrivateKey *)privateKey
                       certificate:(nonnull PSPDFX509 *)certificate
                     hashAlgorithm:(PSPDFSignatureHashAlgorithm)hashAlgorithm
               encryptionAlgorithm:
                   (PSPDFSignatureEncryptionAlgorithm)encryptionAlgorithm;

    Swift

    class func create(_ digest: Data, privateKey: PSPDFPrivateKey, certificate: PSPDFX509, hashAlgorithm: PDFSignatureHashAlgorithm, encryptionAlgorithm: PDFSignatureEncryptionAlgorithm) -> PKCS7

    Parameters

    digest

    The digest data that will be cryptographically protected by this PKCS7. For digital signatures this is typically all the PDF document except the signature contents.

    privateKey

    The private key that will be used to encrypt the digest.

    certificate

    An instance of an X509 certificate that will be used to validate the authenticity of the signer.

    hashAlgorithm

    The hash algorithm that was used to hash the digest argument.

    encryptionAlgorithm

    The encryption algorithm that will be used to encrypt the data using the cryptographic resources also passed to this function as arguments.

  • Returns this PKCS7 structure as data.

    Declaration

    Objective-C

    - (nonnull NSData *)data;

    Swift

    func data() -> Data