System.Security.Policy.StrongName Class

Assembly: Mscorlib.dll
Namespace: System.Security.Policy
Summary
Provides the strong name of a code assembly as evidence for policy evaluation. This class cannot be inherited.
C# Syntax:
[Serializable]
public sealed class StrongName : IIdentityPermissionFactory
Remarks
The StrongName class represents evidence of a unique, cryptographically strong name of a code assembly. The strong name consists of a public key, a given name, and a version. The public key corresponds to the publisher's private key which is kept secret, and with which the assembly must be signed in order for the strong name to be valid.

Strong names are typically assigned to assemblies using either AssemblyKeyFileAttribute, System.Reflection.AssemblyKeyNameAttribute (not supported on the shared source CLI) or AssemblyDelaySignAttribute in conjunction with the SN utility (see ).

StrongNameIdentityPermission uses this class to confirm that calling code is in a particular strong-named code assembly.

See also:
System.Security.Policy Namespace

System.Security.Policy.StrongName Member List:

Public Constructors
ctor #1 Initializes a new instance of the StrongName class with the strong name public key blob, name, and version.
Public Properties
Name Read-only

Gets the simple name of the current StrongName.
PublicKey Read-only

Gets the StrongNamePublicKeyBlob of the current StrongName.
Version Read-only

Gets the Version of the current StrongName.
Public Methods
Copy Creates an equivalent copy of the current StrongName.
CreateIdentityPermission Creates a StrongNameIdentityPermission that corresponds to the current StrongName.
Equals Overridden:
Determines whether the specified strong name is equal to the current strong name.
GetHashCode Overridden:
Gets the hash code of the current StrongName.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
ToString Overridden:
Creates a string representation of the current StrongName.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Security.Policy.StrongName Member Details

ctor #1
Summary
Initializes a new instance of the StrongName class with the strong name public key blob, name, and version.
C# Syntax:
public StrongName(StrongName(
   StrongNamePublicKeyBlob blob,
   string name,
   Version version
);
Parameters:

blob

The StrongNamePublicKeyBlob of the software publisher.

name

The simple name section of the strong name.

version

The Version of the strong name.

Exceptions
Exception Type Condition
ArgumentNullException The blob parameter is null.

-or-

The name parameter is null.

-or-

The version parameter is null.

Remarks
For more information on strong names, see StrongNameIdentityPermission and StrongNamePublicKeyBlob.

Return to top


Property: Name (read-only)
Summary
Gets the simple name of the current StrongName.
C# Syntax:
public string Name {get;}

Return to top


Property: PublicKey (read-only)
Summary
Gets the StrongNamePublicKeyBlob of the current StrongName.
C# Syntax:
public StrongNamePublicKeyBlob PublicKey {get;}
Remarks
A blob is cryptographic information that uniquely specifies the public key of the software publisher.

Blobs differ from certificates in that the blob only has information about the public key; the certificate also includes information that associates the name of the holder with the key as well as information to verify the certificate.

Return to top


Property: Version (read-only)
Summary
Gets the Version of the current StrongName.
C# Syntax:
public Version Version {get;}
See also:
Version

Return to top


Method: Copy()
Summary
Creates an equivalent copy of the current StrongName.
C# Syntax:
public object Copy();
Return Value:
A new, identical copy of the current StrongName.

Return to top


Method: CreateIdentityPermission(
   Evidence evidence
)
Summary
Creates a StrongNameIdentityPermission that corresponds to the current StrongName.
C# Syntax:
public IPermission CreateIdentityPermission(
   Evidence evidence
);
Parameters:

evidence

The Evidence from which to construct the StrongNameIdentityPermission.

Return Value:
A StrongNameIdentityPermission for the specified StrongName.
Implements:
IIdentityPermissionFactory.CreateIdentityPermission
Remarks
The identity permission for a strong name can be used to determine whether calling code is in a particular strong named code assembly.

Return to top


Overridden Method: Equals(
   object o
)
Summary
Determines whether the specified strong name is equal to the current strong name.
C# Syntax:
public override bool Equals(
   object o
);
Parameters:

o

The strong name to compare against the current strong name.

Return Value:
true if the specified strong name is equal to the current strong name; otherwise, false.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~StrongName();

For more information on members inherited from System.Object click on the link above.

Return to top


Overridden Method: GetHashCode()
Summary
Gets the hash code of the current StrongName.
C# Syntax:
public override int GetHashCode();
Return Value:
The hash code of the current StrongName.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Overridden Method: ToString()
Summary
Creates a string representation of the current StrongName.
C# Syntax:
public override string ToString();
Return Value:
A representation of the current StrongName.
Remarks
This method is useful during debugging to get an easy-to-read representation of the object.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.