/crypto-pubkey-openssh

OpenSSH keys decoder/encoder

Primary LanguageHaskellMIT LicenseMIT

crypto-pubkey-openssh Build Status

OpenSSH keys decoder/encoder, example.

import System.Environment (getArgs)
import qualified Data.ByteString as B

import Crypto.PubKey.OpenSsh (decodePrivate)

main :: IO ()
main = do
    fname <- fmap head getArgs
    content <- B.readFile fname
    case decodePrivate content of
        Left e -> error e
        Right key -> print key