passman-0.2: a simple password manager

Copyright(C) 2018 2019 Jonathan Lamothe
LicenseLGPLv3 (or later)
Maintainerjlamothe1980@gmail.com
Safe HaskellNone
LanguageHaskell2010

Password

Contents

Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Synopsis

Data Types

type PWDatabase = Map String PWData Source #

a mapping of service names to password data

data PWData Source #

data necessary to construct a password

Constructors

PWData 

Fields

Instances
Eq PWData Source # 
Instance details

Defined in Password

Methods

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

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

Show PWData Source # 
Instance details

Defined in Password

ToJSON PWData Source # 
Instance details

Defined in Password

FromJSON PWData Source # 
Instance details

Defined in Password

data PWPolicy Source #

defines a password policy

Constructors

PWPolicy 

Fields

Instances
Eq PWPolicy Source # 
Instance details

Defined in Password

Show PWPolicy Source # 
Instance details

Defined in Password

ToJSON PWPolicy Source # 
Instance details

Defined in Password

FromJSON PWPolicy Source # 
Instance details

Defined in Password

type PWSalt = ByteString Source #

the "salt" used to generate a password

Lenses

The following functions are automatically generated by makeLenses. See the lens package for further details.

PWPolicy

Default Instances

newPWDatabase :: PWDatabase Source #

default (empty) password database

newPWData Source #

Arguments

:: RandomGen g 
=> g

the random generator to use

-> (PWData, g)

the result and new random generator

builds a new PWData

newPWPolicy :: PWPolicy Source #

default password policy

newPWSalt Source #

Arguments

:: RandomGen g 
=> g

the random generator to use

-> (PWSalt, g)

the result and new random generator

builds a new salt

Validations

validatePWDatabase Source #

Arguments

:: PWDatabase

the database to be validated

-> Bool

True if valid; False otherwise

validates a password database

validatePWData Source #

Arguments

:: PWData

the data to be validated

-> Bool

True if valid; False otherwise

validates password data

validatePWPolicy Source #

Arguments

:: PWPolicy

the policy being validated

-> Bool

indicates whether or not the policy is valid

validates a password policy

Functions

Password Generator

pwGenerate Source #

Arguments

:: String

the master password

-> PWData

the password parameters

-> Maybe String

the resulting password, if possible; Nothing if the data is invalid

generates a password

Password Checkers

pwCountUpper Source #

Arguments

:: String

the password

-> Int

the count

counts upper case characters in a password

pwCountLower Source #

Arguments

:: String

the password

-> Int

the count

counts lower case characters in a password

pwCountDigits Source #

Arguments

:: String

the password

-> Int

the count

counts digits in a password

pwCountSpecial Source #

Arguments

:: String

the password

-> Int

the count

counts special characters in a password

pwCount Source #

Arguments

:: (Char -> Bool)

the constraint

-> String

the string being checked

-> Int

the count

counts characters matching a specific constraint

Database Functions

pwHasService Source #

Arguments

:: String

the service name

-> PWDatabase

the database to check

-> Bool

returns True if found; False otherwise

checks to see if a service is in the database

pwSetService Source #

Arguments

:: String

the service name

-> PWData

the password data for the service

-> PWDatabase

the database to add to

-> PWDatabase

the resulting database

adds a service to the database, or overwrites an existing one

pwGetService Source #

Arguments

:: String

the service name

-> PWDatabase

the database to check

-> Maybe PWData

the service's password data, or Nothing if the service is not found

attempts to get a service from the database

pwRemoveService Source #

Arguments

:: String

the service being removed

-> PWDatabase

the database the service is being removed from

-> PWDatabase

the resulting database

removes a service from the database

pwSearch Source #

Arguments

:: String

the search string

-> PWDatabase

the database to search

-> [String]

the matching service names

searches for a service

Orphan instances