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 ¶
- Variables
- func GenerateAndSave(name, organization string, validity time.Duration) (tlsc *tls.Certificate, err error)
- func GetTLSCertificate(cert *x509.Certificate, priv *rsa.PrivateKey, hostname string, ...) (*tls.Certificate, error)
- func NewCertificatePair(name, organization string, validity time.Duration) (*x509.Certificate, *rsa.PrivateKey, error)
- func PemBlockForKey(priv interface{}) (*pem.Block, error)
Constants ¶
This section is empty.
Variables ¶
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 ¶
PemBlockForKey - based on key returns a block
Types ¶
This section is empty.