int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
	{
	unsigned char *p;

	if ((a == NULL) || (a->data == NULL)) return(0);

	if (pp == NULL)
		return(ASN1_object_size(0,a->length,V_ASN1_OBJECT));

	p= *pp;
	ASN1_put_object(&p,0,a->length,V_ASN1_OBJECT,V_ASN1_UNIVERSAL);
	memcpy(p,a->data,a->length);
	p+=a->length;

	*pp=p;
	return(a->length);
	}