PEM Serialized Public Key Loader
Load a PEM public key without the password drama
- keyfile
- loaded_key
PEMPublicKey is the public half of the pack's key-loading pair: it takes a PEM public key blob and hands you back a KEYOBJ you can feed into verification, encryption, or whatever asymmetric operation the pack supports. If your ARG or workflow involves signatures - say, proving a clue file wasn't tampered with - this is the node that gets the public key into the graph so you can check it.
The mechanism is a single serialization.load_pem_public_key() call from Python's cryptography library, same trust level as its private-key sibling. Public keys are unencrypted by definition, which is why this node is even simpler than PEMPrivateKey: there's no password input to worry about, just the key material.
The inputs are exactly one:
- keyfile - the PEM content as bytes (BYTESLIKE). That means the
-----BEGIN PUBLIC KEY-----header and the base64 body must be part of the byte stream you feed in, which usually means reading a.pemor.pubfile with a file loader node.
Output is loaded_key, a KEYOBJ. It plugs into the pack's asymmetric nodes downstream - the verifying or encrypting side of whatever you're doing - and it's not meant to be rendered as text. That's the design of the pack's key story: loaders produce KEYOBJ, consumers take KEYOBJ, and you never paste a key around the graph as a string.
Install is the standard pack dance: ComfyUI Manager → search "ComfyUI ARG Toolkit" → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/AzelusLightvale/ComfyUI-ARG-Toolkit
Restart ComfyUI; it's under ARG Toolkit/Cryptography/Modern/Asymmetric, right next to PEMPrivateKey and the DER loaders. No model downloads; the cryptography library that does the parsing comes with the pack.
One honest gotcha to keep in your back pocket: cryptography's public-key loader is strict about formats, and "public key" PEM can come in a few flavors (the plain PUBLIC KEY envelope vs. the older RSA PUBLIC KEY one). If loading fails with a message that mentions the format, try converting the key with openssl rsa -pubin -in key.pub -outform PEM to normalize it. And remember the pack's own disclaimer - amateur project, tests cover the common cases - so an unusual but valid key is more likely to trip the parser than it is to be your fault. For the standard case, this node just works.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| keyfile | BYTESLIKE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| loaded_key | KEYOBJ | — |