func MakeX509NameFromDefaults(template, request *pkix.Name) pkix.Name {
	rval := pkix.Name{}
	if template == nil {
		template = &pkix.Name{}
	}

	rval.Country = request.Country
	if len(rval.Country) == 0 {
		rval.Country = template.Country
	}

	rval.Organization = request.Organization
	if len(rval.Organization) == 0 {
		rval.Organization = template.Organization
	}

	rval.OrganizationalUnit = request.OrganizationalUnit
	if len(rval.OrganizationalUnit) == 0 {
		rval.OrganizationalUnit = template.OrganizationalUnit
	}

	rval.Locality = request.Locality
	if len(rval.Locality) == 0 {
		rval.Locality = template.Locality
	}

	rval.Province = request.Province
	if len(rval.Province) == 0 {
		rval.Province = template.Province
	}

	rval.StreetAddress = request.StreetAddress
	if len(rval.StreetAddress) == 0 {
		rval.StreetAddress = template.StreetAddress
	}

	rval.PostalCode = request.PostalCode
	if len(rval.PostalCode) == 0 {
		rval.PostalCode = template.PostalCode
	}

	rval.SerialNumber = request.SerialNumber
	if rval.SerialNumber == "" {
		rval.SerialNumber = template.SerialNumber
	}

	rval.CommonName = request.CommonName
	if rval.CommonName == "" {
		rval.CommonName = template.CommonName
	}

	rval.Names = request.Names
	if len(rval.Names) == 0 {
		rval.Names = template.Names
	}

	rval.ExtraNames = request.ExtraNames
	if len(rval.ExtraNames) == 0 {
		rval.ExtraNames = template.ExtraNames
	}

	return rval
}
// MakeX509NameFromDefaults constructs a new x509 name from the merging of a
// default and request name. Fields not set in the request name
// will be copied from the default name.
MakeX509NameFromDefaults constructs a new x509 name from the merging of a
default and request name. Fields not set in the request name
will be copied from the default name.
// MakeX509NameFromDefaults constructs a new x509 name from the merging of a // default and request name . Fields not set in the request name // will be copied from the default name .
func MakeX509NameFromDefaults(template, request *pkix.Name) pkix.Name {
	rval := pkix.Name{}
	if template == nil {
		template = &pkix.Name{}
	}
	rval.Country = request.Country
	if len(rval.Country) == 0 {
		rval.Country = template.Country
	}
	rval.Organization = request.Organization
	if len(rval.Organization) == 0 {
		rval.Organization = template.Organization
	}
	rval.OrganizationalUnit = request.OrganizationalUnit
	if len(rval.OrganizationalUnit) == 0 {
		rval.OrganizationalUnit = template.OrganizationalUnit
	}
	rval.Locality = request.Locality
	if len(rval.Locality) == 0 {
		rval.Locality = template.Locality
	}
	rval.Province = request.Province
	if len(rval.Province) == 0 {
		rval.Province = template.Province
	}
	rval.StreetAddress = request.StreetAddress
	if len(rval.StreetAddress) == 0 {
		rval.StreetAddress = template.StreetAddress
	}
	rval.PostalCode = request.PostalCode
	if len(rval.PostalCode) == 0 {
		rval.PostalCode = template.PostalCode
	}
	rval.SerialNumber = request.SerialNumber
	if rval.SerialNumber == "" {
		rval.SerialNumber = template.SerialNumber
	}
	rval.CommonName = request.CommonName
	if rval.CommonName == "" {
		rval.CommonName = template.CommonName
	}
	rval.Names = request.Names
	if len(rval.Names) == 0 {
		rval.Names = template.Names
	}
	rval.ExtraNames = request.ExtraNames
	if len(rval.ExtraNames) == 0 {
		rval.ExtraNames = template.ExtraNames
	}
	return rval
}
func MakeX509NameFromDefaults ( template , request * pkix . Name ) pkix . Name { rval := pkix . Name { } if template == nil { template = & pkix . Name { } } rval . Country = request . Country if len ( rval . Country ) == 0 { rval . Country = template . Country } rval . Organization = request . Organization if len ( rval . Organization ) == 0 { rval . Organization = template . Organization } rval . OrganizationalUnit = request . OrganizationalUnit if len ( rval . OrganizationalUnit ) == 0 { rval . OrganizationalUnit = template . OrganizationalUnit } rval . Locality = request . Locality if len ( rval . Locality ) == 0 { rval . Locality = template . Locality } rval . Province = request . Province if len ( rval . Province ) == 0 { rval . Province = template . Province } rval . StreetAddress = request . StreetAddress if len ( rval . StreetAddress ) == 0 { rval . StreetAddress = template . StreetAddress } rval . PostalCode = request . PostalCode if len ( rval . PostalCode ) == 0 { rval . PostalCode = template . PostalCode } rval . SerialNumber = request . SerialNumber if rval . SerialNumber == " " { rval . SerialNumber = template . SerialNumber } rval . CommonName = request . CommonName if rval . CommonName == " " { rval . CommonName = template . CommonName } rval . Names = request . Names if len ( rval . Names ) == 0 { rval . Names = template . Names } rval . ExtraNames = request . ExtraNames if len ( rval . ExtraNames ) == 0 { rval . ExtraNames = template . ExtraNames } return rval }
MakeX509NameFromDefaults constructs a new x509 name from the merging of a
default and request name.
MakeX509NameFromDefaults constructs a new x509 name from the merging of a default and request name .