PSPDFAESCryptoOutputStream


@interface PSPDFAESCryptoOutputStream : PSPDFCryptoOutputStream

AES decryption, RNCryptor data format (see https://github.com/RNCryptor/RNCryptor-Spec/blob/master/RNCryptor-Spec-v3.md )

  • Designated initializer with the passphrase. The encryption key salt and HMAC key salt will be saved in the file header. Returns nil if the underlying crypto context can’t be initialized or if the encryption feature is not enabled.

    Declaration

    Objective-C

    - (nullable instancetype)initWithOutputStream:(nonnull NSOutputStream *)stream
                                       passphrase:(nonnull NSString *)passphrase;

    Swift

    init?(outputStream stream: OutputStream, passphrase: String)
  • Check the streamStatus after calling this method. Due to AES CBC encryption is working finalized data is written during this call. If it fails the streamStatus is set to NSStreamStatusError and streamError holds the detailed info.

    Declaration

    Objective-C

    - (void)close;

    Swift

    func close()