internal IPsecSecurityAssociationAuthInformation(IPSEC_SA0 sa) : base(sa) { var auth_info = sa.ptr.ReadStruct <IPSEC_SA_AUTH_INFORMATION0>(); Key = auth_info.authKey.ToArray(); CryptoModuleId = auth_info.authTransform.cryptoModuleId.ReadGuid(); Type = auth_info.authTransform.authTransformId.authType; Config = auth_info.authTransform.authTransformId.authConfig; }
internal IPsecSecurityAssociationCipherInformation(IPSEC_SA0 sa) : base(sa) { var cipher_info = sa.ptr.ReadStruct <IPSEC_SA_CIPHER_INFORMATION0>(); Key = cipher_info.cipherKey.ToArray(); CryptoModuleId = cipher_info.cipherTransform.cryptoModuleId.ReadGuid(); Type = cipher_info.cipherTransform.cipherTransformId.cipherType; Config = cipher_info.cipherTransform.cipherTransformId.cipherConfig; }
internal static IPsecSecurityAssociationParameter Create(IPSEC_SA0 sa) { switch (sa.saTransformType) { case IPsecTransformType.AH: case IPsecTransformType.EspAuth: case IPsecTransformType.EspAuthFw: return(new IPsecSecurityAssociationAuthInformation(sa)); case IPsecTransformType.EspCipher: return(new IPsecSecurityAssociationCipherInformation(sa)); case IPsecTransformType.EspAuthAndCipher: return(new IPsecSecurityAssociationAuthCipherInformation(sa)); } return(new IPsecSecurityAssociationParameter(sa)); }
internal IPsecSecurityAssociationAuthCipherInformation(IPSEC_SA0 sa) : base(sa) { var auth_and_cipher_info = sa.ptr.ReadStruct <IPSEC_SA_AUTH_AND_CIPHER_INFORMATION0>(); var auth_info = auth_and_cipher_info.saAuthInformation; AuthKey = auth_info.authKey.ToArray(); AuthCryptoModuleId = auth_info.authTransform.cryptoModuleId.ReadGuid(); AuthType = auth_info.authTransform.authTransformId.authType; AuthConfig = auth_info.authTransform.authTransformId.authConfig; var cipher_info = auth_and_cipher_info.saCipherInformation; CipherKey = cipher_info.cipherKey.ToArray(); CipherCryptoModuleId = cipher_info.cipherTransform.cryptoModuleId.ReadGuid(); CipherType = cipher_info.cipherTransform.cipherTransformId.cipherType; CipherConfig = cipher_info.cipherTransform.cipherTransformId.cipherConfig; }
private protected IPsecSecurityAssociationParameter(IPSEC_SA0 sa) { Index = sa.spi; TransformType = sa.saTransformType; }