PSPDFCryptoInputStream

Objective-C


@interface PSPDFCryptoInputStream : NSInputStream

Swift

class CryptoInputStream : InputStream

Encryption input stream.

  • Returns nil if the encryption feature is not enabled.

    Declaration

    Objective-C

    - (nullable instancetype)
        initWithInputStream:(nonnull NSInputStream *)stream
            decryptionBlock:
                (nullable NSInteger (^)(PSPDFCryptoInputStream *_Nonnull,
                                        uint8_t *_Nonnull,
                                        NSInteger))decryptionBlock;

    Swift

    init?(inputStream stream: InputStream, decryptionBlock: ((CryptoInputStream, UnsafeMutablePointer<UInt8>, Int) -> Int)? = nil)
  • Set the decryption handler. If no decryption block is called, this input stream will simply pass the data through. Return the length of the decrypted buffer. This block is assuming you are decrypting inline.

    Note

    Set this property before the input stream is being used.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSInteger (^_Nonnull) (PSPDFCryptoInputStream *_Nonnull, uint8_t *_Nonnull, NSInteger) decryptionBlock;

    Swift

    var decryptionBlock: (CryptoInputStream, UnsafeMutablePointer<UInt8>, Int) -> Int { get set }