Skip to content

Latest commit

 

History

History
142 lines (78 loc) · 5.07 KB

onion_x509.md

File metadata and controls

142 lines (78 loc) · 5.07 KB

Module onion_x509

x509 API.

Authors: Alexander Færøy (ahf@0x90.dk).

Description

Data Types


options() = #{public_key => onion_rsa:public_key(), valid_from => calendar:datetime(), valid_to => calendar:datetime(), subject => [{subject(), term()}], issuer => [{subject(), term()}], version => v1 | v2 | v3, serial => non_neg_integer(), digest => sha | sha256 | sha384 | sha512 | md5}

subject() = name | email | city | state | org | org_unit | country | serial | title | dnQualifier

Function Index

create_certificate/1
der_decode/1
der_encode/1
is_self_signed/1
not_after/1
not_before/1
public_key/1
sign/2
verify/2

Function Details

create_certificate/1


create_certificate(Options) -> {ok, Certificate} | {error, Reason}

der_decode/1


der_decode(CertificateDer) -> {ok, Certificate} | {error, Reason}

der_encode/1


der_encode(Certificate) -> {ok, CertificateDer} | {error, Reason}

is_self_signed/1


is_self_signed(Certificate) -> boolean()

not_after/1


not_after(Certificate) -> calendar:datetime()

not_before/1


not_before(Certificate) -> calendar:datetime()

public_key/1


public_key(Certificate) -> {ok, onion_rsa:public_key()} | {error, Reason}

sign/2


sign(Certificate, SecretKey) -> CertificateDer

verify/2


verify(CertificateDer, Key) -> boolean()