import * as em from "../../Enums"; import { SecurityHandlerBase } from "./SecurityHandlerBase"; /** * Defines base class for Standard Security Handlers. * These security handlers allow access permissions and up to two passwords to be specified for a document: * an owner password and a user password. **/ export declare abstract class StandardSecurityHandler extends SecurityHandlerBase { /** * Gets a combination of flags that indicate how the password specified * when loading the PDF matches the document's User and Owner passwords. */ get passwordMatches(): em.PasswordMatches; /** * Gets the access type granted by this {@link StandardSecurityHandler}, or null. * This property is initialized when a document is loaded. */ get accessType(): em.AccessType | null; /** * Gets the revision of this {@link StandardSecurityHandler}. */ get revision(): number; /** * Gets or sets the password required to open a PDF document as a string. * The two properties {@link userPassword} and {@link userPasswordBytes} allow * to define the password as a string or as an array of bytes. * According to the PDF specification, a string password should be converted to an array of bytes * using the system code page (if the standard security handler with revision 4 or less is used). * In some environments the system code page is unavailable, so DsPdf cannot perform this conversion. * If the password string only contains ASCII chars, this does not present a problem. * But if the password string contains non-ASCII Unicode characters, it is up to the developer * to perform the conversion and set the password using {@link userPasswordBytes}. */ get userPassword(): string; /** * Gets or sets the password required to open a PDF document as a string. * The two properties {@link userPassword} and {@link userPasswordBytes} allow * to define the password as a string or as an array of bytes. * According to the PDF specification, a string password should be converted to an array of bytes * using the system code page (if the standard security handler with revision 4 or less is used). * In some environments the system code page is unavailable, so DsPdf cannot perform this conversion. * If the password string only contains ASCII chars, this does not present a problem. * But if the password string contains non-ASCII Unicode characters, it is up to the developer * to perform the conversion and set the password using {@link userPasswordBytes}. */ set userPassword(value: string); /** * Gets or sets the password required to open a PDF document as a byte array. * The two properties {@link userPassword} and {@link userPasswordBytes} allow * to define the password as a string or as an array of bytes. * According to the PDF specification, a string password should be converted to an array of bytes * using the system code page (if the standard security handler with revision 4 or less is used). * In some environments the system code page is unavailable, so DsPdfJS cannot perform this conversion. * If the password string only contains ASCII chars, this does not present a problem. * But if the password string contains non-ASCII Unicode characters, it is up to the developer * to perform the conversion and set the password using this property. */ get userPasswordBytes(): Uint8Array; /** * Gets or sets the password required to open a PDF document as a byte array. * The two properties {@link userPassword} and {@link userPasswordBytes} allow * to define the password as a string or as an array of bytes. * According to the PDF specification, a string password should be converted to an array of bytes * using the system code page (if the standard security handler with revision 4 or less is used). * In some environments the system code page is unavailable, so DsPdfJS cannot perform this conversion. * If the password string only contains ASCII chars, this does not present a problem. * But if the password string contains non-ASCII Unicode characters, it is up to the developer * to perform the conversion and set the password using this property. */ set userPasswordBytes(value: Uint8Array); /** * Gets or sets the password required to change permissions of a PDF document as a string. * The two properties {@link ownerPassword} and {@link ownerPasswordBytes} allow * to define the password as a string or as an array of bytes. * According to the PDF specification, a string password should be converted to an array of bytes * using the system code page (if the standard security handler with revision 4 or less is used). * In some environments the system code page is unavailable, so DsPdfJS cannot perform this conversion. * If the password string only contains ASCII chars, this does not present a problem. * But if the password string contains non-ASCII Unicode characters, it is up to the developer * to perform the conversion and set the password using this property. */ get ownerPassword(): string; /** * Gets or sets the password required to change permissions of a PDF document as a string. * The two properties {@link ownerPassword} and {@link ownerPasswordBytes} allow * to define the password as a string or as an array of bytes. * According to the PDF specification, a string password should be converted to an array of bytes * using the system code page (if the standard security handler with revision 4 or less is used). * In some environments the system code page is unavailable, so DsPdfJS cannot perform this conversion. * If the password string only contains ASCII chars, this does not present a problem. * But if the password string contains non-ASCII Unicode characters, it is up to the developer * to perform the conversion and set the password using this property. */ set ownerPassword(value: string); /** * Gets or sets the password required to change permissions of a PDF document as a byte array. * The two properties {@link ownerPassword} and {@link ownerPasswordBytes} allow * to define the password as a string or as an array of bytes. * According to the PDF specification, a string password should be converted to an array of bytes * using the system code page (if the standard security handler with revision 4 or less is used). * In some environments the system code page is unavailable, so DsPdfJS cannot perform this conversion. * If the password string only contains ASCII chars, this does not present a problem. * But if the password string contains non-ASCII Unicode characters, it is up to the developer * to perform the conversion and set the password using this property. */ get ownerPasswordBytes(): Uint8Array; /** * Gets or sets the password required to change permissions of a PDF document as a byte array. * The two properties {@link ownerPassword} and {@link ownerPasswordBytes} allow * to define the password as a string or as an array of bytes. * According to the PDF specification, a string password should be converted to an array of bytes * using the system code page (if the standard security handler with revision 4 or less is used). * In some environments the system code page is unavailable, so DsPdfJS cannot perform this conversion. * If the password string only contains ASCII chars, this does not present a problem. * But if the password string contains non-ASCII Unicode characters, it is up to the developer * to perform the conversion and set the password using this property. */ set ownerPasswordBytes(value: Uint8Array); }