示例#1
0
 /// <summary>
 /// Creates a stand-alone signature from a stand-alone sig metadata row.
 /// </summary>
 /// <param name="parentModule"></param>
 /// <param name="token">The token to initialize the signature for.</param>
 /// <param name="row">The metadata table row to base the signature on.</param>
 public SerializedStandAloneSignature(SerializedModuleDefinition parentModule,
                                      MetadataToken token, StandAloneSignatureRow row)
     : base(token)
 {
     _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule));
     _row          = row;
 }
示例#2
0
        /// <inheritdoc />
        public MetadataToken GetStandAloneSignatureToken(StandAloneSignature signature)
        {
            var table = Metadata.TablesStream.GetTable <StandAloneSignatureRow>(TableIndex.StandAloneSig);
            var row   = new StandAloneSignatureRow(
                Metadata.BlobStream.GetBlobIndex(this, signature.Signature));

            var token = table.Add(row);

            AddCustomAttributes(token, signature);
            return(token);
        }