77using System . Collections . Generic ;
88using System . Runtime . InteropServices ;
99using System . Security . Cryptography . X509Certificates ;
10- using NuGet . Packaging . Signing . Utility ;
1110using System . Linq ;
1211using System . Security . Cryptography ;
1312using System . Security . Cryptography . Pkcs ;
@@ -108,16 +107,16 @@ internal byte[] GetRepositoryCountersignatureSignatureValue()
108107 pointer ,
109108 ref unsignedAttributeCount ) ) ;
110109
111- var unsignedAttributes = MarshalUtility . PtrToStructure < CRYPT_ATTRIBUTES > ( pointer ) ;
112- int sizeOfCryptAttributeString = MarshalUtility . SizeOf < CRYPT_ATTRIBUTE_STRING > ( ) ;
113- int sizeOfCryptIntegerBlob = MarshalUtility . SizeOf < CRYPT_INTEGER_BLOB > ( ) ;
110+ var unsignedAttributes = Marshal . PtrToStructure < CRYPT_ATTRIBUTES > ( pointer ) ;
111+ int sizeOfCryptAttributeString = Marshal . SizeOf < CRYPT_ATTRIBUTE_STRING > ( ) ;
112+ int sizeOfCryptIntegerBlob = Marshal . SizeOf < CRYPT_INTEGER_BLOB > ( ) ;
114113
115114 for ( uint i = 0 ; i < unsignedAttributes . cAttr ; ++ i )
116115 {
117116
118117 var attributePointer = new IntPtr (
119118 ( long ) unsignedAttributes . rgAttr + ( i * sizeOfCryptAttributeString ) ) ;
120- var attribute = MarshalUtility . PtrToStructure < CRYPT_ATTRIBUTE_STRING > ( attributePointer ) ;
119+ var attribute = Marshal . PtrToStructure < CRYPT_ATTRIBUTE_STRING > ( attributePointer ) ;
121120
122121 if ( ! string . Equals ( attribute . pszObjId , Oids . Countersignature , StringComparison . Ordinal ) )
123122 {
@@ -128,7 +127,7 @@ internal byte[] GetRepositoryCountersignatureSignatureValue()
128127 {
129128 var attributeValuePointer = new IntPtr (
130129 ( long ) attribute . rgValue + ( j * sizeOfCryptIntegerBlob ) ) ;
131- var attributeValue = MarshalUtility . PtrToStructure < CRYPT_INTEGER_BLOB > ( attributeValuePointer ) ;
130+ var attributeValue = Marshal . PtrToStructure < CRYPT_INTEGER_BLOB > ( attributeValuePointer ) ;
132131 uint cbSignerInfo = 0 ;
133132
134133 NativeUtility . ThrowIfFailed ( NativeMethods . CryptDecodeObject (
@@ -151,7 +150,7 @@ internal byte[] GetRepositoryCountersignatureSignatureValue()
151150 pvStructInfo : counterSignerInfoPointer ,
152151 pcbStructInfo : new IntPtr ( & cbSignerInfo ) ) ) ;
153152
154- var counterSignerInfo = MarshalUtility . PtrToStructure < CMSG_SIGNER_INFO > ( counterSignerInfoPointer ) ;
153+ var counterSignerInfo = Marshal . PtrToStructure < CMSG_SIGNER_INFO > ( counterSignerInfoPointer ) ;
155154
156155 if ( IsRepositoryCounterSignerInfo ( counterSignerInfo ) )
157156 {
@@ -171,12 +170,12 @@ internal byte[] GetRepositoryCountersignatureSignatureValue()
171170 private static bool IsRepositoryCounterSignerInfo ( CMSG_SIGNER_INFO counterSignerInfo )
172171 {
173172 var signedAttributes = counterSignerInfo . AuthAttrs ;
174- int sizeOfCryptAttributeString = MarshalUtility . SizeOf < CRYPT_ATTRIBUTE_STRING > ( ) ;
173+ int sizeOfCryptAttributeString = Marshal . SizeOf < CRYPT_ATTRIBUTE_STRING > ( ) ;
175174 for ( var i = 0 ; i < signedAttributes . cAttr ; ++ i )
176175 {
177176 var signedAttributePointer = new IntPtr (
178177 ( long ) signedAttributes . rgAttr + ( i * sizeOfCryptAttributeString ) ) ;
179- var signedAttribute = MarshalUtility . PtrToStructure < CRYPT_ATTRIBUTE_STRING > ( signedAttributePointer ) ;
178+ var signedAttribute = Marshal . PtrToStructure < CRYPT_ATTRIBUTE_STRING > ( signedAttributePointer ) ;
180179 if ( string . Equals ( signedAttribute . pszObjId , Oids . CommitmentTypeIndication , StringComparison . Ordinal ) &&
181180 IsRepositoryCounterSignerInfo ( signedAttribute ) )
182181 {
@@ -189,13 +188,13 @@ private static bool IsRepositoryCounterSignerInfo(CMSG_SIGNER_INFO counterSigner
189188
190189 private static bool IsRepositoryCounterSignerInfo ( CRYPT_ATTRIBUTE_STRING commitmentTypeIndicationAttribute )
191190 {
192- int sizeOfCryptIntegerBlob = MarshalUtility . SizeOf < CRYPT_INTEGER_BLOB > ( ) ;
191+ int sizeOfCryptIntegerBlob = Marshal . SizeOf < CRYPT_INTEGER_BLOB > ( ) ;
193192
194193 for ( var i = 0 ; i < commitmentTypeIndicationAttribute . cValue ; ++ i )
195194 {
196195 var attributeValuePointer = new IntPtr (
197196 ( long ) commitmentTypeIndicationAttribute . rgValue + ( i * sizeOfCryptIntegerBlob ) ) ;
198- var attributeValue = MarshalUtility . PtrToStructure < CRYPT_INTEGER_BLOB > ( attributeValuePointer ) ;
197+ var attributeValue = Marshal . PtrToStructure < CRYPT_INTEGER_BLOB > ( attributeValuePointer ) ;
199198 var bytes = new byte [ attributeValue . cbData ] ;
200199
201200 Marshal . Copy ( attributeValue . pbData , bytes , startIndex : 0 , length : bytes . Length ) ;
@@ -317,7 +316,7 @@ internal unsafe void AddTimestampToRepositoryCountersignature(SignedCms timestam
317316 var signerInfo = repositoryCountersignature . Value . SignerInfo ;
318317 var unauthAttrCount = signerInfo . UnauthAttrs . cAttr + 1 ;
319318
320- var sizeOfCryptAttribute = MarshalUtility . SizeOf < CRYPT_ATTRIBUTE > ( ) ;
319+ var sizeOfCryptAttribute = Marshal . SizeOf < CRYPT_ATTRIBUTE > ( ) ;
321320 var attributesArray = ( CRYPT_ATTRIBUTE * ) hb . Alloc ( ( int ) ( sizeOfCryptAttribute * unauthAttrCount ) ) ;
322321 var currentAttribute = attributesArray ;
323322
@@ -326,7 +325,7 @@ internal unsafe void AddTimestampToRepositoryCountersignature(SignedCms timestam
326325 {
327326 var existingAttributePointer = new IntPtr (
328327 ( long ) signerInfo . UnauthAttrs . rgAttr + ( i * sizeOfCryptAttribute ) ) ;
329- var existingAttribute = MarshalUtility . PtrToStructure < CRYPT_ATTRIBUTE > ( existingAttributePointer ) ;
328+ var existingAttribute = Marshal . PtrToStructure < CRYPT_ATTRIBUTE > ( existingAttributePointer ) ;
330329
331330 currentAttribute ->pszObjId = existingAttribute . pszObjId ;
332331 currentAttribute ->cValue = existingAttribute . cValue ;
0 commit comments