-
Notifications
You must be signed in to change notification settings - Fork 103
Open
Labels
Description
I have been working on a project where this error is significant
Line 256 in 426fe5a
| err = errors.New("pkcs12: expected exactly two safe bags in the PFX PDU") |
Can we create a predefined error value for this?. It makes it easy for error value comparison. I suggest something like this
var ErrExpectedTwoSafeBags error = errors.New("pkcs12: expected exactly two safe bags in the PFX PDU")So We can do something like this
pfx, cert, err := pkcs12.Decode(pfxData, password)
if errors.Is(err,pkcs12.ErrExpectedTwoSafeBags){
// LoadChain
}instead of
if err.Error() == "pkcs12: expected exactly two safe bags in the PFX PDU" {
}