This print for content only-size & color not accurate 7" X 9-1/4" / casebound / malloy


■ I N T R O D U C I N G   . N E T  A S S E M B L I E S 505



Download 21,46 Mb.
Pdf ko'rish
bet984/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   980   981   982   983   984   985   986   987   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition

I N T R O D U C I N G   . N E T  A S S E M B L I E S



505

8849CH15.qxd  10/22/07  1:46 PM  Page 505




To provide a strong name for an assembly, your first step is to generate public/private key data

using the .NET Framework 3.5 SDK’s sn.exe utility (which you’ll do momentarily). The sn.exe utility

responds by generating a file (typically ending with the *.snk [Strong Name Key] file extension) that

contains data for two distinct but mathematically related keys, the “public” key and the “private”

key. Once the C# compiler is made aware of the location for your *.snk file, it will record the full

public key value in the assembly manifest using the .publickey token at the time of compilation.

The C# compiler will also generate a hash code based on the contents of the entire assembly

(CIL code, metadata, and so forth). As you recall from Chapter 6, a 



hash code is a numerical value

that is statistically unique for a fixed input. Thus, if you modify any aspect of a .NET assembly (even

a single character in a string literal) the compiler yields a different hash code. This hash code is

combined with the private key data within the *.snk file to yield a digital signature embedded

within the assembly’s CLR header data. The process of strongly naming an assembly is illustrated

in Figure 15-18.



Figure 15-18.

At compile time, a digital signature is generated and embedded into the assembly based

in part on public and private key data.

Understand that the actual private key data is not listed anywhere within the manifest, but is

used only to digitally sign the contents of the assembly (in conjunction with the generated hash

code). Again, the whole idea of making use of public/private key data is to ensure that no two com-

panies, departments, or individuals have the same identity in the .NET universe. In any case, once

the process of assigning a strong name is complete, the assembly may be installed into the GAC.




Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   980   981   982   983   984   985   986   987   ...   1830




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish