Skip to content

esachser/obbsubjectextractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenBanking Brasil Subject DN extractor

Using this lib you will be capable of extract the subject DN following RFC 4514 definitions, with aditional translation of OIDs to names specified by the OpenBanking Brasil security specs.

The implementation follows the rules at August 26, 2021.

History

Version Date (aprox.) of spec
initial August 26, 2021

Installation

Lib

go get github.com/esachser/obbsubjectextractor

Command

go get github.com/esachser/obbsubjectextractor/cmd/obbsubextractor

Usage - lib

Example from the cmd folder;

import (
	"crypto/x509"
	"encoding/pem"
	"flag"
	"fmt"
	"os"
	"path/filepath"

	"github.com/esachser/obbsubjectextractor"
)

func main() {
	filename := os.Args[1]
	pemFile, _ := os.ReadFile(filename)
	pemBlock, _ := pem.Decode(pemFile)
	cert, _ := x509.ParseCertificate(pemBlock.Bytes)

	subjectDN, err := obbsubjectextractor.ExtractSubject(cert)

	fmt.Println(subjectDN, err)
}

Usage - command

obbsubextractor <path-to-pem>

About

Extractor of subject DN for OpenBanking Brasil

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages