@@ -75,7 +75,7 @@ func NewErrProposedCertificateDoesNotExist(subject string, subjectKeyID string)
75
75
return errors .Wrapf (ErrProposedCertificateDoesNotExist ,
76
76
"No proposed X509 root certificate associated " +
77
77
"with the combination of subject=%v and subjectKeyID=%v on the ledger. " +
78
- "The cerificate either does not exists or already approved. " ,
78
+ "The certificate either does not exists, already approved or rejected " ,
79
79
subject , subjectKeyID )
80
80
}
81
81
@@ -115,11 +115,15 @@ func NewErrProposedCertificateRevocationAlreadyExists(subject string, subjectKey
115
115
subject , subjectKeyID )
116
116
}
117
117
118
- func NewErrProposedCertificateRevocationDoesNotExist (subject string , subjectKeyID string ) error {
118
+ func NewErrProposedCertificateRevocationDoesNotExist (subject string , subjectKeyID string , serialNumber string ) error {
119
+ if serialNumber != "" {
120
+ serialNumber = " and serialNumber=" + serialNumber
121
+ }
122
+
119
123
return errors .Wrapf (ErrProposedCertificateRevocationDoesNotExist ,
120
124
"No proposed X509 root certificate revocation associated " +
121
- "with the combination of subject=%v and subjectKeyID=%v on the ledger." ,
122
- subject , subjectKeyID )
125
+ "with the combination of subject=%v, subjectKeyID=%v %v on the ledger." ,
126
+ subject , subjectKeyID , serialNumber )
123
127
}
124
128
125
129
func NewErrRevokedCertificateDoesNotExist (subject string , subjectKeyID string ) error {
@@ -235,6 +239,20 @@ func NewErrRootCertVidNotEqualToAccountVid(rootVID int32, accountVID int32) erro
235
239
rootVID , accountVID )
236
240
}
237
241
242
+ func NewErrRevokeRootCertVidNotEqualToAccountVid (rootVID int32 , accountVID int32 ) error {
243
+ return errors .Wrapf (ErrCertVidNotEqualAccountVid ,
244
+ "Only a Vendor associated with VID of root certificate can revoke certificate: " +
245
+ "Root certificate's VID = %v, Account VID = %v" ,
246
+ rootVID , accountVID )
247
+ }
248
+
249
+ func NewErrRevokeCertVidNotEqualToAccountVid (rootVID int32 , accountVID int32 ) error {
250
+ return errors .Wrapf (ErrCertVidNotEqualAccountVid ,
251
+ "Only a Vendor associated with VID of certificate can revoke certificate: " +
252
+ "Certificate's VID = %v, Account VID = %v" ,
253
+ rootVID , accountVID )
254
+ }
255
+
238
256
func NewErrCRLSignerCertificateInvalidFormat (description string ) error {
239
257
return errors .Wrapf (
240
258
ErrCRLSignerCertificateInvalidFormat , "Invalid CRL Signer Certificate format: %v" ,
0 commit comments