diff options
Diffstat (limited to 'ext/node/polyfills/_crypto/crypto_browserify/asn1.js/encoders/pem.js')
-rw-r--r-- | ext/node/polyfills/_crypto/crypto_browserify/asn1.js/encoders/pem.js | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/ext/node/polyfills/_crypto/crypto_browserify/asn1.js/encoders/pem.js b/ext/node/polyfills/_crypto/crypto_browserify/asn1.js/encoders/pem.js deleted file mode 100644 index d2487e1ce..000000000 --- a/ext/node/polyfills/_crypto/crypto_browserify/asn1.js/encoders/pem.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -// Copyright 2017 Fedor Indutny. All rights reserved. MIT license. - -import { DEREncoder } from "internal:deno_node/polyfills/_crypto/crypto_browserify/asn1.js/encoders/der.js"; - -export function PEMEncoder(entity) { - DEREncoder.call(this, entity); - this.enc = "pem"; -} -// inherits(PEMEncoder, DEREncoder); -PEMEncoder.prototype = Object.create(DEREncoder.prototype, { - constructor: { - value: PEMEncoder, - enumerable: false, - writable: true, - configurable: true, - }, -}); - -PEMEncoder.prototype.encode = function encode(data, options) { - const buf = DEREncoder.prototype.encode.call(this, data); - - const p = buf.toString("base64"); - const out = ["-----BEGIN " + options.label + "-----"]; - for (let i = 0; i < p.length; i += 64) { - out.push(p.slice(i, i + 64)); - } - out.push("-----END " + options.label + "-----"); - return out.join("\n"); -}; |