PSPDFCryptoInputStream

Objective-C

@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

Swift

class CryptoInputStream : InputStream

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: ((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 }