(crc-24 input)returns the crc24 checksum
(crc-24 (byte-array [100 100 100 100 100 100])) => ["=6Fko" [-24 89 40] 15227176]
returns the crc24 checksum (crc-24 (byte-array [100 100 100 100 100 100])) => ["=6Fko" [-24 89 40] 15227176]
(decrypt encrypted {:keys [private]})decrypts the encrypted information
(-> (.getBytes "Hello World") (encrypt {:public +public-key+}) (decrypt {:private +private-key+}) (String.)) => "Hello World"
decrypts the encrypted information
(-> (.getBytes "Hello World")
(encrypt {:public +public-key+})
(decrypt {:private +private-key+})
(String.))
=> "Hello World"(encrypt clear {:keys [public]})encrypts bytes given a public key
(->> (encrypt (.getBytes "Hello World") {:public +public-key+})
(encode/to-base64))
encrypts bytes given a public key
(->> (encrypt (.getBytes "Hello World")
{:public +public-key+})
(encode/to-base64))(fingerprint pub)returns the fingerprint of a public key
(fingerprint +public-key+) => "E710D59C5346D3C0A1C578AE6753F8E16D35FC24"
returns the fingerprint of a public key (fingerprint +public-key+) => "E710D59C5346D3C0A1C578AE6753F8E16D35FC24"
(generate-signature bytes {:keys [public private]})generates a signature given bytes and a keyring
(generate-signature (.getBytes "Hello World") {:public +public-key+ :private +private-key+}) ;; #gpg.signature ["iQEcBAABCAAGBQJbw1U8AAoJEGdT+OFtNf... "] => org.bouncycastle.openpgp.PGPSignature
generates a signature given bytes and a keyring
(generate-signature (.getBytes "Hello World")
{:public +public-key+
:private +private-key+})
;; #gpg.signature ["iQEcBAABCAAGBQJbw1U8AAoJEGdT+OFtNf... "]
=> org.bouncycastle.openpgp.PGPSignature(key-pair secret-key)returns a public and private key pair from a secret key
(key-pair +secret-key+) ;;[#public "E710D59C5346D3C0A1C578AE6753F8E16D35FC24" #private "7445568256057146404"] => (contains [org.bouncycastle.openpgp.PGPPublicKey org.bouncycastle.openpgp.PGPPrivateKey])
returns a public and private key pair from a secret key
(key-pair +secret-key+)
;;[#public "E710D59C5346D3C0A1C578AE6753F8E16D35FC24" #private "7445568256057146404"]
=> (contains [org.bouncycastle.openpgp.PGPPublicKey
org.bouncycastle.openpgp.PGPPrivateKey])(parse-public-key input)(parse-public-key input id)parses a public key from string
(-> (string/joinl +public-key-string+ "\n") (parse-public-key)) ;; #public "E710D59C5346D3C0A1C578AE6753F8E16D35FC24" => org.bouncycastle.openpgp.PGPPublicKey
parses a public key from string
(-> (string/joinl +public-key-string+ "\n")
(parse-public-key))
;; #public "E710D59C5346D3C0A1C578AE6753F8E16D35FC24"
=> org.bouncycastle.openpgp.PGPPublicKey(parse-public-key-ring input)parses a public key ring from string
(-> (string/joinl +public-key-string+ "\n") (parse-public-key-ring)) => org.bouncycastle.openpgp.PGPPublicKeyRing
parses a public key ring from string
(-> (string/joinl +public-key-string+ "\n")
(parse-public-key-ring))
=> org.bouncycastle.openpgp.PGPPublicKeyRing(parse-secret-key input)(parse-secret-key input id)parses a secret key from string
(-> (string/joinl +secret-key-string+ "\n") (parse-secret-key)) ;; #secret "E710D59C5346D3C0A1C578AE6753F8E16D35FC24" => org.bouncycastle.openpgp.PGPSecretKey
parses a secret key from string
(-> (string/joinl +secret-key-string+ "\n")
(parse-secret-key))
;; #secret "E710D59C5346D3C0A1C578AE6753F8E16D35FC24"
=> org.bouncycastle.openpgp.PGPSecretKey(parse-secret-key-ring input)parses a secret key ring from string
(-> (string/joinl +secret-key-string+ "\n") (parse-secret-key-ring)) => org.bouncycastle.openpgp.PGPSecretKeyRing
parses a secret key ring from string
(-> (string/joinl +secret-key-string+ "\n")
(parse-secret-key-ring))
=> org.bouncycastle.openpgp.PGPSecretKeyRing(pgp-signature bytes)returns a gpg signature from encoded bytes
(-> (generate-signature (.getBytes "Hello World") {:public +public-key+ :private +private-key+}) (.getEncoded) (pgp-signature)) => org.bouncycastle.openpgp.PGPSignature
returns a gpg signature from encoded bytes
(-> (generate-signature (.getBytes "Hello World")
{:public +public-key+
:private +private-key+})
(.getEncoded)
(pgp-signature))
=> org.bouncycastle.openpgp.PGPSignature(read-sig-file sig-file)reads bytes from a GPG compatible file
(read-sig-file "dev/scratch/project.clj.asc") => bytes?
reads bytes from a GPG compatible file (read-sig-file "dev/scratch/project.clj.asc") => bytes?
(sign input sig-file {:keys [public private] :as opts})generates a output gpg signature for an input file
(sign "project.clj" "dev/scratch/project.clj.asc" {:public +public-key+ :private +private-key+}) => bytes?
generates a output gpg signature for an input file
(sign "project.clj"
"dev/scratch/project.clj.asc"
{:public +public-key+
:private +private-key+})
=> bytes?(verify input sig-file {:keys [public]})verifies that the signature works
(verify "project.clj" "dev/scratch/project.clj.asc" {:public +public-key+}) => true
verifies that the signature works
(verify "project.clj"
"dev/scratch/project.clj.asc"
{:public +public-key+})
=> true(write-sig-file sig-file bytes)writes bytes to a GPG compatible file
(let [signature (-> (generate-signature (.getBytes "Hello World") {:public +public-key+ :private +private-key+}) (.getEncoded))] (write-sig-file "dev/scratch/project.clj.asc" signature))
writes bytes to a GPG compatible file
(let [signature (-> (generate-signature (.getBytes "Hello World")
{:public +public-key+
:private +private-key+})
(.getEncoded))]
(write-sig-file "dev/scratch/project.clj.asc"
signature))cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |