certs

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

This file is a modified version of:

https://github.com/SpectoLabs/hoverfly/blob/718c09aaabc3c2b36ab48abb78bc3a43404108c7/certs/certs.go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var MaxSerialNumber = big.NewInt(0).SetBytes(bytes.Repeat([]byte{255}, 20))

MaxSerialNumber - nothing very original, big number

Functions

func GenerateAndSave

func GenerateAndSave(name, organization string, validity time.Duration) (tlsc *tls.Certificate, err error)

GenerateAndSave - generates cert and key and saves them on your disk

func GetTLSCertificate

func GetTLSCertificate(cert *x509.Certificate, priv *rsa.PrivateKey, hostname string, validity time.Duration) (*tls.Certificate, error)

GetTLSCertificate - takes x509 cert and private key, returns tls.Certificate that is ready for proxy use

func NewCertificatePair

func NewCertificatePair(name, organization string, validity time.Duration) (*x509.Certificate, *rsa.PrivateKey, error)

NewCertificatePair - returns x509 cert + private key

func PemBlockForKey

func PemBlockForKey(priv interface{}) (*pem.Block, error)

PemBlockForKey - based on key returns a block

Types

This section is empty.

Jump to

Keyboard shortcuts

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