PSPDFCryptoInputStream

@interface PSPDFCryptoInputStream : NSInputStream

/// Returns nil if the encryption feature is not enabled.
- (nullable instancetype)initWithInputStream:(NSInputStream *)stream decryptionBlock:(nullable NSInteger (^)(PSPDFCryptoInputStream *superStream, uint8_t *buffer, NSInteger len))decryptionBlock;

/// 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.
@property (nonatomic, copy) NSInteger (^decryptionBlock)(PSPDFCryptoInputStream *stream, uint8_t *buffer, NSInteger len);

@end

Undocumented

  • 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: ((PSPDFCryptoInputStream, 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 (readwrite, copy, nonatomic) NSInteger (^_Nonnull)
        (PSPDFCryptoInputStream *_Nonnull, uint8_t *_Nonnull, NSInteger)
            decryptionBlock;

    Swift

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