| License | Apache-2.0 |
|---|---|
| Maintainer | Timothy Klim <hackage@timothyklim.com> |
| Stability | experimental |
| Portability | unknown |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.X509.PKCS10
Contents
Description
Read/Write PKCS10 certificate signing request (also CSR or certification request).
Follows RFC2986
Synopsis
- data X520Attribute
- = X520CommonName
- | X520SerialNumber
- | X520Name
- | X520Surname
- | X520GivenName
- | X520Initials
- | X520GenerationQualifier
- | X520CountryName
- | X520LocalityName
- | X520StateOrProvinceName
- | X520StreetAddress
- | X520OrganizationName
- | X520OrganizationalUnitName
- | X520Title
- | X520DNQualifier
- | X520Pseudonym
- | X509SubjectAltName
- | EmailAddress
- | IPAddress
- | DomainComponent
- | UserId
- | RawAttribute [Integer]
- newtype X520Attributes = X520Attributes [(X520Attribute, ASN1CharacterString)]
- data PKCS9Attribute = (Extension e, Show e, Eq e, Typeable e) => PKCS9Attribute e
- newtype PKCS9Attributes = PKCS9Attributes [PKCS9Attribute]
- data CertificationRequestInfo = CertificationRequestInfo {}
- data CertificationRequest = CertificationRequest {}
- data SignedCertificationRequest = SignedCertificationRequest {}
- newtype Version = Version Int
- newtype Signature = Signature ByteString
- data KeyPair
- makeX520Attributes :: [(X520Attribute, String)] -> X520Attributes
- generateCSR :: (MonadRandom m, HashAlgorithmConversion hashAlg, HashAlgorithm hashAlg) => X520Attributes -> PKCS9Attributes -> KeyPair -> hashAlg -> m (Either Error CertificationRequest)
- csrToSigned :: CertificationRequest -> SignedCertificationRequest
- verify :: SignedCertificationRequest -> PubKey -> Bool
- toDER :: CertificationRequest -> ByteString
- fromDER :: ByteString -> Either Error SignedCertificationRequest
- toPEM :: CertificationRequest -> PEM
- toNewFormatPEM :: CertificationRequest -> PEM
- fromPEM :: PEM -> Either Error SignedCertificationRequest
Documentation
data X520Attribute #
A list of X520 attributes.
Constructors
Instances
| Eq X520Attribute # | |
Defined in Data.X509.PKCS10 Methods (==) :: X520Attribute -> X520Attribute -> Bool # (/=) :: X520Attribute -> X520Attribute -> Bool # | |
| Show X520Attribute # | |
Defined in Data.X509.PKCS10 Methods showsPrec :: Int -> X520Attribute -> ShowS # show :: X520Attribute -> String # showList :: [X520Attribute] -> ShowS # | |
| OIDable X520Attribute # | |
Defined in Data.X509.PKCS10 Methods getObjectID :: X520Attribute -> OID # | |
| OIDNameable X520Attribute # | |
Defined in Data.X509.PKCS10 Methods fromObjectID :: OID -> Maybe X520Attribute # | |
newtype X520Attributes #
X520 attributes.
Constructors
| X520Attributes [(X520Attribute, ASN1CharacterString)] |
Instances
| Eq X520Attributes # | |
Defined in Data.X509.PKCS10 Methods (==) :: X520Attributes -> X520Attributes -> Bool # (/=) :: X520Attributes -> X520Attributes -> Bool # | |
| Show X520Attributes # | |
Defined in Data.X509.PKCS10 Methods showsPrec :: Int -> X520Attributes -> ShowS # show :: X520Attributes -> String # showList :: [X520Attributes] -> ShowS # | |
| ASN1Object X520Attributes # | |
Defined in Data.X509.PKCS10 | |
data PKCS9Attribute #
A list of PKCS9 extension attributes.
Constructors
| (Extension e, Show e, Eq e, Typeable e) => PKCS9Attribute e |
Instances
| Eq PKCS9Attribute # | |
Defined in Data.X509.PKCS10 Methods (==) :: PKCS9Attribute -> PKCS9Attribute -> Bool # (/=) :: PKCS9Attribute -> PKCS9Attribute -> Bool # | |
| Show PKCS9Attribute # | |
Defined in Data.X509.PKCS10 Methods showsPrec :: Int -> PKCS9Attribute -> ShowS # show :: PKCS9Attribute -> String # showList :: [PKCS9Attribute] -> ShowS # | |
| ASN1Object PKCS9Attribute # | |
Defined in Data.X509.PKCS10 | |
newtype PKCS9Attributes #
PKCS9 extension attributes.
Constructors
| PKCS9Attributes [PKCS9Attribute] |
Instances
| Eq PKCS9Attributes # | |
Defined in Data.X509.PKCS10 Methods (==) :: PKCS9Attributes -> PKCS9Attributes -> Bool # (/=) :: PKCS9Attributes -> PKCS9Attributes -> Bool # | |
| Show PKCS9Attributes # | |
Defined in Data.X509.PKCS10 Methods showsPrec :: Int -> PKCS9Attributes -> ShowS # show :: PKCS9Attributes -> String # showList :: [PKCS9Attributes] -> ShowS # | |
| ASN1Object PKCS9Attributes # | |
Defined in Data.X509.PKCS10 | |
data CertificationRequestInfo #
Certificate request info.
Constructors
| CertificationRequestInfo | |
Fields | |
Instances
| Eq CertificationRequestInfo # | |
Defined in Data.X509.PKCS10 Methods (==) :: CertificationRequestInfo -> CertificationRequestInfo -> Bool # (/=) :: CertificationRequestInfo -> CertificationRequestInfo -> Bool # | |
| Show CertificationRequestInfo # | |
Defined in Data.X509.PKCS10 Methods showsPrec :: Int -> CertificationRequestInfo -> ShowS # show :: CertificationRequestInfo -> String # showList :: [CertificationRequestInfo] -> ShowS # | |
| ASN1Object CertificationRequestInfo # | |
Defined in Data.X509.PKCS10 | |
data CertificationRequest #
CSR class.
Constructors
| CertificationRequest | |
Instances
| Eq CertificationRequest # | |
Defined in Data.X509.PKCS10 Methods (==) :: CertificationRequest -> CertificationRequest -> Bool # (/=) :: CertificationRequest -> CertificationRequest -> Bool # | |
| Show CertificationRequest # | |
Defined in Data.X509.PKCS10 Methods showsPrec :: Int -> CertificationRequest -> ShowS # show :: CertificationRequest -> String # showList :: [CertificationRequest] -> ShowS # | |
| ASN1Object CertificationRequest # | |
Defined in Data.X509.PKCS10 | |
data SignedCertificationRequest #
A signed CSR class.
Constructors
| SignedCertificationRequest | |
Instances
| Eq SignedCertificationRequest # | |
Defined in Data.X509.PKCS10 Methods (==) :: SignedCertificationRequest -> SignedCertificationRequest -> Bool # (/=) :: SignedCertificationRequest -> SignedCertificationRequest -> Bool # | |
| Show SignedCertificationRequest # | |
Defined in Data.X509.PKCS10 Methods showsPrec :: Int -> SignedCertificationRequest -> ShowS # show :: SignedCertificationRequest -> String # showList :: [SignedCertificationRequest] -> ShowS # | |
Signature of certificate request info.
Constructors
| Signature ByteString |
Key pair for RSA and DSA keys.
Constructors
| KeyPairRSA PublicKey PrivateKey | |
| KeyPairDSA PublicKey PrivateKey |
makeX520Attributes :: [(X520Attribute, String)] -> X520Attributes #
Helper to convert string values as utf8 asn1 strings.
generateCSR :: (MonadRandom m, HashAlgorithmConversion hashAlg, HashAlgorithm hashAlg) => X520Attributes -> PKCS9Attributes -> KeyPair -> hashAlg -> m (Either Error CertificationRequest) #
Generate CSR.
csrToSigned :: CertificationRequest -> SignedCertificationRequest #
Sign CSR.
verify :: SignedCertificationRequest -> PubKey -> Bool #
Verify signed CSR.
toDER :: CertificationRequest -> ByteString #
Convert CSR to DER as ByteString.
fromDER :: ByteString -> Either Error SignedCertificationRequest #
Convert ByteString to signed CSR.
toPEM :: CertificationRequest -> PEM #
Convert CSR to PEM format.
toNewFormatPEM :: CertificationRequest -> PEM #
Convert CSR to PEM new format.
fromPEM :: PEM -> Either Error SignedCertificationRequest #
Convert PEM to signed CSR.