public ISchemeIfc Build() { ValidateSchemeParameters(); ISchemeIfc scheme = null; switch (_schemeParameters.KasAlgoAttributes.Scheme) { case IfcScheme.Kas1_basic: case IfcScheme.Kas1_partyV_keyConfirmation: scheme = new SchemeBaseKasOneKeyPair( _entropyProvider, _schemeParameters, _fixedInfoFactory, _fixedInfoParameter, _thisPartyKeyingMaterialBuilder, _keyConfirmationFactory, _macParameters, _kdfVisitor, _kdfParameters, _rsaSve); break; case IfcScheme.Kas2_basic: case IfcScheme.Kas2_bilateral_keyConfirmation: case IfcScheme.Kas2_partyU_keyConfirmation: case IfcScheme.Kas2_partyV_keyConfirmation: scheme = new SchemeBaseKasTwoKeyPair( _entropyProvider, _schemeParameters, _fixedInfoFactory, _fixedInfoParameter, _thisPartyKeyingMaterialBuilder, _keyConfirmationFactory, _macParameters, _kdfVisitor, _kdfParameters, _rsaSve); break; case IfcScheme.Kts_oaep_basic: case IfcScheme.Kts_oaep_partyV_keyConfirmation: scheme = new SchemeKts( _entropyProvider, _schemeParameters, _fixedInfoFactory, _fixedInfoParameter, _thisPartyKeyingMaterialBuilder, _keyConfirmationFactory, _macParameters, _ktsFactory, _ktsParameters); break; default: throw new ArgumentException(nameof(_schemeParameters.KasAlgoAttributes.Scheme)); } if (_thisPartyKeyingMaterial != null) { scheme.ThisPartyKeyingMaterial = _thisPartyKeyingMaterial; } return(scheme); }
public KasIfc(ISchemeIfc scheme) { Scheme = scheme; }