# Adding external library to postman in order to do cryptograp

**URL:** <https://community.postman.com/t/adding-external-library-to-postman-in-order-to-do-cryptograp/52432>\
**Category:** Help Hub\
**Tags:** external-library\
**Created:** [September 26, 2023, 4:25pm UTC](https://community.postman.com/t/adding-external-library-to-postman-in-order-to-do-cryptograp/52432 "2023-09-26T16:25:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mission-engineer-822](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@mission-engineer-822](https://community.postman.com/u/mission-engineer-822)\
**Post date:** [September 26, 2023, 4:25pm UTC](https://community.postman.com/t/adding-external-library-to-postman-in-order-to-do-cryptograp/52432/1 "2023-09-26T16:25:31Z")

</div>

what is the best way to add external cryptographic library to postman. I want to use this library in pre request script and the solution on the forum doesnt work for me :// I try with unpkg packages too but i have got “SyntaxError: Unexpected token ‘\<’” error. My goal is to sign specific data with private key

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [September 26, 2023, 4:37pm UTC](https://community.postman.com/t/adding-external-library-to-postman-in-order-to-do-cryptograp/52432/2 "2023-09-26T16:37:30Z")

</div>

Hey @mission-engineer-822 👋

Welcome to the Postman Community! :postman:

Could you also share the topics that you have been using to find the solution, please?

We have this Collection on our [Postman Answers Public Workspace](https://www.postman.com/postman/workspace/postman-answers) that also might be useful here:

[https://www.postman.com/postman/workspace/postman-answers/collection/13455110-7a6c90f0-0062-4089-b206-27c803dc1c37](https://www.postman.com/postman/workspace/postman-answers/collection/13455110-7a6c90f0-0062-4089-b206-27c803dc1c37)

---

<div class="post-metadata">

**Author:** ![mission-engineer-822](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@mission-engineer-822](https://community.postman.com/u/mission-engineer-822)\
**Post date:** [September 26, 2023, 4:49pm UTC](https://community.postman.com/t/adding-external-library-to-postman-in-order-to-do-cryptograp/52432/3 "2023-09-26T16:49:04Z")

</div>

hi i used this two topics: [GitHub - loveiset/RSAForPostman: add rsa encryt for postman](https://github.com/loveiset/RSAForPostman) and [Example Code for Postman to generate HTTP Signature · GitHub](https://gist.github.com/abramovholvi/ce515f73853e03aa5a59650f66ed57b9) and also like i said i try [JavaScript libraries — Postman Quick Reference Guide Version 1.9.1 - January 2023 documentation](https://postman-quick-reference-guide.readthedocs.io/en/latest/libraries.html) this option with for example this link [UNPKG - node-forge](https://unpkg.com/browse/node-forge@1.3.1/dist/forge.min.js)  
And if i have implementation like this: `pm.sendRequest(“[https://raw.githubusercontent.com/loveiset/RSAForPostman/master/forge.js](https://raw.githubusercontent.com/loveiset/RSAForPostman/master/forge.js)”, function (err, res) {  
if (err) {  
console.log(err);  
} else {  
eval(res.text())  
}

```
    function getPrivateKey() {
    return this.forge.pki.privateKeyFromPem(PRIVATE_KEY)
    }
    getPrivateKey()

```

})` i have error: Cannot read properties of undefined (reading ‘pki’).  
When i remove this before forge word i have got forge not found exception or too few bytes to parse DER. So i dont know what i should do and what is the correct way to implement this

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [October 26, 2023, 4:49pm UTC](https://community.postman.com/t/adding-external-library-to-postman-in-order-to-do-cryptograp/52432/4 "2023-10-26T16:49:36Z")

</div>

Closed on October 26, 2023, 4:49pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
