/// <summary> /// Verify the MechListMIC based on initial MechType list of the current packet /// </summary> /// <param name="securityContext">Specific security context</param> /// <param name="signature">Signature of the initial MechListMIC</param> /// <returns>True if the signature matches the signed message, otherwise false</returns> internal bool VerifyMechListMIC(SecurityContext securityContext, byte[] signature) { byte[] unsignedMechList = SpngUtility.EncodeAsn1(context.InitMechTypeList); return(securityContext.Verify(unsignedMechList, signature)); }
public override byte[] ToBytes() { return(SpngUtility.EncodeAsn1(this.asn1Token)); }
/// <summary> /// Generate the MechListMIC based on MechType list of the current packet /// </summary> /// <param name="securityContext">Specific security context</param> /// <returns>MechListMIC</returns> internal byte[] GenerateMechListMIC(SecurityContext securityContext) { byte[] unsignedMechList = SpngUtility.EncodeAsn1(context.InitMechTypeList); return(securityContext.Sign(unsignedMechList)); }