Skip to content

Commit

Permalink
🏷️
Browse files Browse the repository at this point in the history
  • Loading branch information
vbuch committed Oct 5, 2023
1 parent 025f99b commit 31d6907
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
17 changes: 16 additions & 1 deletion packages/signpdf/dist/signpdf.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
/**
* @typedef {object} SignerOptions
* @prop {string} [passphrase]
* @prop {boolean} [asn1StrictParsing]
*/
export class SignPdf {
byteRangePlaceholder: "**********";
lastSignature: string;
sign(pdfBuffer: any, p12Buffer: any, additionalOptions?: {}): Buffer;
/**
* @param {Buffer} pdfBuffer
* @param {Buffer} p12Buffer
* @param {SignerOptions} additionalOptions
* @returns {Buffer}
*/
sign(pdfBuffer: Buffer, p12Buffer: Buffer, additionalOptions?: SignerOptions): Buffer;
}
declare const _default: SignPdf;
export default _default;
export type SignerOptions = {
passphrase?: string;
asn1StrictParsing?: boolean;
};
//# sourceMappingURL=signpdf.d.ts.map
2 changes: 1 addition & 1 deletion packages/signpdf/dist/signpdf.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions packages/signpdf/dist/signpdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,24 @@ exports.default = exports.SignPdf = void 0;
var _nodeForge = _interopRequireDefault(require("node-forge"));
var _utils = require("@signpdf/utils");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @typedef {object} SignerOptions
* @prop {string} [passphrase]
* @prop {boolean} [asn1StrictParsing]
*/

class SignPdf {
constructor() {
this.byteRangePlaceholder = _utils.DEFAULT_BYTE_RANGE_PLACEHOLDER;
this.lastSignature = null;
}

/**
* @param {Buffer} pdfBuffer
* @param {Buffer} p12Buffer
* @param {SignerOptions} additionalOptions
* @returns {Buffer}
*/
sign(pdfBuffer, p12Buffer, additionalOptions = {}) {
const options = {
asn1StrictParsing: false,
Expand Down
12 changes: 12 additions & 0 deletions packages/signpdf/src/signpdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,24 @@ import {
SignPdfError,
} from '@signpdf/utils';

/**
* @typedef {object} SignerOptions
* @prop {string} [passphrase]
* @prop {boolean} [asn1StrictParsing]
*/

export class SignPdf {
constructor() {
this.byteRangePlaceholder = DEFAULT_BYTE_RANGE_PLACEHOLDER;
this.lastSignature = null;
}

/**
* @param {Buffer} pdfBuffer
* @param {Buffer} p12Buffer
* @param {SignerOptions} additionalOptions
* @returns {Buffer}
*/
sign(
pdfBuffer,
p12Buffer,
Expand Down

0 comments on commit 31d6907

Please sign in to comment.