// ParseCertificateRequest parses a single certificate request from the
// given ASN.1 DER data.
ParseCertificateRequest parses a single certificate request from the
given ASN.1 DER data.
// ParseCertificateRequest parses a single certificate request from the // given ASN . 1 DER data .
func ParseCertificateRequest(asn1Data []byte) (*CertificateRequest, error) {
	var (
		cr      *C.X509_REQ
		dlen    = C.long(len(asn1Data))
		buf     = (*C.uchar)(&asn1Data[0])
		counter = C.long(0)
	)
	cr = C.d2i_X509_REQ_with_counter(&buf, dlen, &counter)
	if cr == nil {
		return nil, errors.New("error parsing der data: " + sslerr.SSLErrorMessage().String())
	}
	certReq, err := getCertificateRequest(asn1Data[:counter], cr)
	if err != nil {
		return nil, err
	}
	return certReq, nil
}
func ParseCertificateRequest ( asn1Data [ ] byte ) ( * CertificateRequest , error ) { var ( cr * C . X509_REQ dlen = C . long ( len ( asn1Data ) ) buf = ( * C . uchar ) ( & asn1Data [ 0 ] ) counter = C . long ( 0 ) ) cr = C . d2i_X509_REQ_with_counter ( & buf , dlen , & counter ) if cr == nil { return nil , errors . New ( " " + sslerr . SSLErrorMessage ( ) . String ( ) ) } certReq , err := getCertificateRequest ( asn1Data [ : counter ] , cr ) if err != nil { return nil , err } return certReq , nil }
ParseCertificateRequest parses a single certificate request from the
given ASN.1 DER data.
ParseCertificateRequest parses a single certificate request from the given ASN . 1 DER data .