aeatnif

package module
v0.0.0-...-329b9b7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2019 License: MIT Imports: 10 Imported by: 0

README

Library to check Spanish NIF/CIF against government web service

Go Report Card

Actions Status

forthebadge

This lib works but requires still some important job to do (for security reasons)

Install

go get github.com/marcelmiguel/aeatnif

Get pfx file

Convert pfc encrypted to pem unencrypted

openssl pkcs12 -in cert.pfx -nodes -out cert.crt

Usage for tests

Put a cert.crt file in the project directory Change aeat-nif_test.go and set password CERTPWD constant (DO NOT UPDATE TO GIT THE PASSWORD !!). Launch tests.

TODO

  • Use Environment variables for file and password of certificate
  • Use secrets in BASE64 to store cert and password for use in Kubernetes
  • Verify caducity of certifcate
  • Enable read encrypted pem
  • Enable read encrypted pfx

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExpired = errors.New("El certificado no es válido")
)

Certificate errors

Functions

This section is empty.

Types

type VNifV2

type VNifV2 struct {
	// contains filtered or unexported fields
}

VNifV2 object for identification id

func NewVNifV2

func NewVNifV2(url string, certFile string, certPassword string) *VNifV2

NewVNifV2 create an object to consult oficial identification for spanish government

func (*VNifV2) SoapCall

func (service *VNifV2) SoapCall(nif string, name string) (*string, *string, error)

SoapCall Call the server to identifycheck if nif and name are valid

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL