Class GOST3410PublicKeyAlgParameters

java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.bouncycastle.asn1.cryptopro.GOST3410PublicKeyAlgParameters
All Implemented Interfaces:
ASN1Encodable, Encodable

public class GOST3410PublicKeyAlgParameters extends ASN1Object
The AlgorithmIdentifier parameters for GOST R 34.10-2001 and GOST R 34.10-2012 keys.

This type covers two structures:

GostR3410-2001-PublicKeyParameters ::= SEQUENCE {      -- RFC 4491, Section 2.3.2
    publicKeyParamSet   OBJECT IDENTIFIER,
    digestParamSet      OBJECT IDENTIFIER,
    encryptionParamSet  OBJECT IDENTIFIER DEFAULT id-Gost28147-89-CryptoPro-A-ParamSet
}

GostR3410-2012-PublicKeyParameters ::= SEQUENCE {      -- RFC 9215, Section 4.2
    publicKeyParamSet   OBJECT IDENTIFIER,
    digestParamSet      OBJECT IDENTIFIER OPTIONAL
}
digestParamSet and encryptionParamSet are consecutive, untagged, and of the same type, so a second element cannot be distinguished by type alone. It is always digestParamSet: the 2001 structure requires digestParamSet ahead of the DEFAULT encryptionParamSet, and the 2012 structure has no encryptionParamSet.

RFC 9215 requires digestParamSet to be omitted for id-tc26-gost-3410-12-256-paramSetB/C/D and says it should be omitted for paramSetA and the 512-bit parameter sets. A digestParamSet present alongside any of those is nevertheless accepted on decode, since older implementations emitted one.