Documentation ¶
Index ¶
- Variables
- func WrapWithWSSESoapEnvelope(dataXML, id string) (result string)
- type Client
- func (cli *Client) Close() (err error)
- func (cli *Client) GetCertFromCMS(cms []byte, signID int) (string, error)
- func (cli *Client) HashGOST95(data []byte) (hashed []byte, err error)
- func (cli *Client) HashSHA256(data []byte) (hashed []byte, err error)
- func (cli *Client) LoadCertFromBytes(cert []byte, certType ckalkan.CertType) (err error)
- func (cli *Client) LoadCerts() error
- func (cli *Client) LoadKeyStore(path, password string) error
- func (cli *Client) LoadKeyStoreFromBytes(key []byte, password string) (err error)
- func (cli *Client) Options() Options
- func (cli *Client) Sign(data []byte, isDetached, withTSP bool) (signature []byte, err error)
- func (cli *Client) SignWSSE(xmlData, id string) (string, error)
- func (cli *Client) SignXML(xmlData string) (string, error)
- func (cli *Client) Underlying() *ckalkan.Client
- func (cli *Client) ValidateCert(cert string) (string, error)
- func (cli *Client) ValidateCertOCSP(cert string, url ...string) (string, error)
- func (cli *Client) Verify(signature []byte) (string, error)
- func (cli *Client) VerifyData(signature []byte) (*ckalkan.VerifiedData, error)
- func (cli *Client) VerifyDetached(signature, data []byte) (string, error)
- func (cli *Client) VerifyXML(signedXML string) (result string, err error)
- func (cli *Client) X509CertificateGetInfo(inCert string, prop ckalkan.CertProp) (string, error)
- type Kalkan
- type Logger
- type Option
- func WithCert(cert *x509.Certificate, typ ckalkan.CertType) Option
- func WithCerts(c []OptionsCert) Option
- func WithLogger(logger Logger) Option
- func WithOCSP(u string) Option
- func WithRemoteProdCerts(ctx context.Context) Option
- func WithRemoteTestCerts(ctx context.Context) Option
- func WithTSP(u string) Option
- type Options
- type OptionsCert
Constants ¶
This section is empty.
Variables ¶
View Source
var ( OptsProd = []Option{ WithLogger(defaultLogger), WithTSP(prodTSP), WithOCSP(prodOCSP), } OptsTest = []Option{ WithLogger(defaultLogger), WithTSP(testTSP), WithOCSP(testOCSP), } )
View Source
var ( ErrInit = errors.New("unable to refer to KC_GetFunctionList") ErrHTTPCli = errors.New("http cli error") )
View Source
var ErrLoadKey = errors.New("load key error")
Functions ¶
func WrapWithWSSESoapEnvelope ¶
WrapWithWSSESoapEnvelope оборачивает XML документ в SOAP формат, а точнее записывает содержимое под тегом soap:Body
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetCertFromCMS ¶
GetCertFromCMS обеспечивает получение сертификата из CMS.
func (*Client) LoadCertFromBytes ¶
func (*Client) LoadKeyStore ¶
LoadKeyStore загружает PKCS12.
func (*Client) LoadKeyStoreFromBytes ¶
LoadKeyStoreFromBytes загружает PKCS12.
func (*Client) Underlying ¶
func (*Client) ValidateCertOCSP ¶
func (*Client) VerifyData ¶
func (cli *Client) VerifyData(signature []byte) (*ckalkan.VerifiedData, error)
func (*Client) VerifyDetached ¶
VerifyDetached обеспечивает проверку отделенной подписи CMS (detached signature) в base64.
type Kalkan ¶
type Kalkan interface { LoadKeyStore(path, password string) (err error) LoadKeyStoreFromBytes(key []byte, password string) (err error) Sign(data []byte, isDetached, withTSP bool) (signature []byte, err error) SignXML(xml string) (signedXML string, err error) SignWSSE(xml, id string) (signedXML string, err error) Verify(signature []byte) (string, error) VerifyData(signature []byte) (*ckalkan.VerifiedData, error) VerifyXML(signedXML string) (string, error) VerifyDetached(signature, data []byte) (string, error) GetCertFromCMS(cms []byte, signID int) (string, error) ValidateCert(cert string) (string, error) ValidateCertOCSP(cert string, url ...string) (string, error) HashSHA256(data []byte) ([]byte, error) HashGOST95(data []byte) ([]byte, error) X509CertificateGetInfo(inCert string, prop ckalkan.CertProp) (string, error) Underlying() *ckalkan.Client Close() error }
Kalkan - это обертка над методами KalkanCrypt.
type Option ¶
type Option func(o *Options)
func WithCerts ¶
func WithCerts(c []OptionsCert) Option
func WithLogger ¶
func WithRemoteProdCerts ¶
func WithRemoteTestCerts ¶
type Options ¶
type Options struct { TSP string `json:"tsp"` // URL метки времени OCSP string `json:"ocsp"` // URL сервиса онлайн проверки статуса сертификата Certs []OptionsCert `json:"certs"` // Корневые сертификатам LoadCerts bool `json:"load_certs"` // contains filtered or unexported fields }
type OptionsCert ¶
type OptionsCert struct { Cert *x509.Certificate Type ckalkan.CertType }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.