amazonka-core-1.4.5: Core data types and functionality for Amazonka libraries.

Copyright(c) 2013-2016 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.Data.Crypto

Contents

Description

 

Synopsis

Conversion

Algorithms

Contexts

hash :: (ByteArrayAccess ba, HashAlgorithm a) => ba -> Digest a #

Hash a strict bytestring into a digest.

hashlazy :: HashAlgorithm a => ByteString -> Digest a #

Hash a lazy bytestring into a digest.

hashInit :: HashAlgorithm a => Context a #

Initialize a new context for this hash algorithm

hashUpdate :: (ByteArrayAccess ba, HashAlgorithm a) => Context a -> ba -> Context a #

run hashUpdates on one single bytestring and return the updated context.

hashFinalize :: HashAlgorithm a => Context a -> Digest a #

Finalize a context and return a digest.

Re-exported

data HMAC a :: * -> * #

Represent an HMAC that is a phantom type with the hash used to produce the mac.

The Eq instance is constant time.

Instances

Eq (HMAC a) 

Methods

(==) :: HMAC a -> HMAC a -> Bool #

(/=) :: HMAC a -> HMAC a -> Bool #

ByteArrayAccess (HMAC a) 

Methods

length :: HMAC a -> Int #

withByteArray :: HMAC a -> (Ptr p -> IO a) -> IO a #

data Digest a :: * -> * #

Represent a digest for a given hash algorithm.

Instances

Eq (Digest a) 

Methods

(==) :: Digest a -> Digest a -> Bool #

(/=) :: Digest a -> Digest a -> Bool #

Ord (Digest a) 

Methods

compare :: Digest a -> Digest a -> Ordering #

(<) :: Digest a -> Digest a -> Bool #

(<=) :: Digest a -> Digest a -> Bool #

(>) :: Digest a -> Digest a -> Bool #

(>=) :: Digest a -> Digest a -> Bool #

max :: Digest a -> Digest a -> Digest a #

min :: Digest a -> Digest a -> Digest a #

Show (Digest a) 

Methods

showsPrec :: Int -> Digest a -> ShowS #

show :: Digest a -> String #

showList :: [Digest a] -> ShowS #

ByteArrayAccess (Digest a) 

Methods

length :: Digest a -> Int #

withByteArray :: Digest a -> (Ptr p -> IO a) -> IO a #

NFData (Digest a) 

Methods

rnf :: Digest a -> () #

ToText (Digest a) Source # 

Methods

toText :: Digest a -> Text Source #

class HashAlgorithm a #

Class representing hashing algorithms.

The interface presented here is update in place and lowlevel. the Hash module takes care of hidding the mutable interface properly.

data MD5 :: * #

MD5 cryptographic hash algorithm

Constructors

MD5 

data Base :: * #

Different bases that can be used

See RFC4648 for details. In particular, Base64 can be standard or URL-safe. URL-safe encoding is often used in other specifications without padding characters.

Constructors

Base16

similar to hexadecimal

Base32 
Base64

standard Base64

Base64URLUnpadded

unpadded URL-safe Base64

Base64OpenBSD

Base64 as used in OpenBSD password encoding (such as bcrypt)

Instances

Eq Base 

Methods

(==) :: Base -> Base -> Bool #

(/=) :: Base -> Base -> Bool #

Show Base 

Methods

showsPrec :: Int -> Base -> ShowS #

show :: Base -> String #

showList :: [Base] -> ShowS #