//Helper function that calls encoding/pem to convert DER to PEM
Helper function that calls encoding/pem to convert DER to PEM
// Helper function that calls encoding / pem to convert DER to PEM
func ParseCertificatePEM(pemData []byte) (*Certificate, error) {
	length := C.int(len(pemData))
	buffer := unsafe.Pointer(&pemData[0])
	bio := C.BIO_new_mem_buf(buffer, length)
	cert := C.PEM_read_bio_X509(bio, nil, nil, nil)
	if cert == nil {
		return nil, errors.New("problem loading certificate" + sslerr.SSLErrorMessage().String())
	}
	return &Certificate{x509: cert}, nil
}
func ParseCertificatePEM ( pemData [ ] byte ) ( * Certificate , error ) { length := C . int ( len ( pemData ) ) buffer := unsafe . Pointer ( & pemData [ 0 ] ) bio := C . BIO_new_mem_buf ( buffer , length ) cert := C . PEM_read_bio_X509 ( bio , nil , nil , nil ) if cert == nil { return nil , errors . New ( " " + sslerr . SSLErrorMessage ( ) . String ( ) ) } return & Certificate { x509 : cert } , nil }
Helper function that calls encoding/pem to convert DER to PEM
Helper function that calls encoding / pem to convert DER to PEM