//Export an OpenSSL X509 to a DER buffer
Export an OpenSSL X509 to a DER buffer
// Export an OpenSSL X509 to a DER buffer
func (self *Certificate) DumpDERCertificate() ([]byte, error) {
	bio := C.BIO_new(C.BIO_s_mem())
	defer C.BIO_free(bio)
	ret := C.i2d_X509_bio(bio, self.x509)
	if ret == 0 {
		return nil, errors.New("problem dumping certificate")
	}
	var temp *C.char
	buf_len := C.BIO_ctrl(bio, C.BIO_CTRL_INFO, 0, unsafe.Pointer(&temp))
	return C.GoBytes(unsafe.Pointer(temp), C.int(buf_len)), nil
}
func ( self * Certificate ) DumpDERCertificate ( ) ( [ ] byte , error ) { bio := C . BIO_new ( C . BIO_s_mem ( ) ) defer C . BIO_free ( bio ) ret := C . i2d_X509_bio ( bio , self . x509 ) if ret == 0 { return nil , errors . New ( " " ) } var temp * C . char buf_len := C . BIO_ctrl ( bio , C . BIO_CTRL_INFO , 0 , unsafe . Pointer ( & temp ) ) return C . GoBytes ( unsafe . Pointer ( temp ) , C . int ( buf_len ) ) , nil }
Export an OpenSSL X509 to a DER buffer
Export an OpenSSL X509 to a DER buffer