signature/policy_config.go
func newPRSignedBy(keyType sbKeyType, keyPath string, keyData []byte, signedIdentity PolicyReferenceMatch) (*prSignedBy, error) {
	if !keyType.IsValid() {
		return nil, InvalidPolicyFormatError(fmt.Sprintf("invalid keyType \"%s\"", keyType))
	}
	if len(keyPath) > 0 && len(keyData) > 0 {
		return nil, InvalidPolicyFormatError("keyType and keyData cannot be used simultaneously")
	}
	if signedIdentity == nil {
		return nil, InvalidPolicyFormatError("signedIdentity not specified")
	}
	return &prSignedBy{
		prCommon:       prCommon{Type: prTypeSignedBy},
		KeyType:        keyType,
		KeyPath:        keyPath,
		KeyData:        keyData,
		SignedIdentity: signedIdentity,
	}, nil
}
func newPRSignedBy(keyType sbKeyType, keyPath string, keyData []byte, signedIdentity PolicyReferenceMatch) (*prSignedBy, error) {
	if !keyType.IsValid() {
		return nil, InvalidPolicyFormatError(fmt.Sprintf("invalid keyType \"%s\"", keyType))
	}
	if len(keyPath) > 0 && len(keyData) > 0 {
		return nil, InvalidPolicyFormatError("keyType and keyData cannot be used simultaneously")
	}
	if signedIdentity == nil {
		return nil, InvalidPolicyFormatError("signedIdentity not specified")
	}
	return &prSignedBy{
		prCommon:       prCommon{Type: prTypeSignedBy},
		KeyType:        keyType,
		KeyPath:        keyPath,
		KeyData:        keyData,
		SignedIdentity: signedIdentity,
	}, nil
}
func newPRSignedBy ( keyType sbKeyType , keyPath string , keyData [ ] byte , signedIdentity PolicyReferenceMatch ) ( * prSignedBy , error ) { if ! keyType . IsValid ( ) { return nil , InvalidPolicyFormatError ( fmt . Sprintf ( " \" \" " , keyType ) ) } if len ( keyPath ) > 0 && len ( keyData ) > 0 { return nil , InvalidPolicyFormatError ( " " ) } if signedIdentity == nil { return nil , InvalidPolicyFormatError ( " " ) } return & prSignedBy { prCommon : prCommon { Type : prTypeSignedBy } , KeyType : keyType , KeyPath : keyPath , KeyData : keyData , SignedIdentity : signedIdentity , } , nil }
// newPRSignedBy returns a new prSignedBy if parameters are valid.
newPRSignedBy returns a new prSignedBy if parameters are valid .