AssemblySignatureKeyAttribute Classe
Definição
Fornece a migração de uma chave de nome forte mais antiga e mais simples para uma chave maior com um algoritmo de hash mais forte.Provides migration from an older, simpler strong name key to a larger key with a stronger hashing algorithm.
public ref class AssemblySignatureKeyAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed class AssemblySignatureKeyAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)>]
type AssemblySignatureKeyAttribute = class
inherit Attribute
Public NotInheritable Class AssemblySignatureKeyAttribute
Inherits Attribute
- Herança
- Atributos
Comentários
A nova chave maior é a chave de assinatura.The new larger key is the signature key. Em versões anteriores ao .NET Framework 4,5, a chave de assinatura era idêntica à chave de identidade.In versions before the .NET Framework 4.5, the signature key was identical to the identity key. A partir do .NET Framework 4,5, o AssemblySignatureKeyAttribute atributo permite que os metadados do assembly continuem a ter o token de chave pública antigo e o blob (objeto binário grande) para que as referências de assembly existentes continuem a funcionar.Starting with the .NET Framework 4.5, the AssemblySignatureKeyAttribute attribute allows the assembly metadata to continue to have the old public key token and binary large object (BLOB) so that existing assembly references continue to work. Ele também garante que o mapeamento venha de um proprietário da chave de identidade.It also ensures that the mapping comes from an owner of the identity key.
A presença do atributo não significa necessariamente que a validação de nome forte ocorra.The presence of the attribute does not necessarily mean that strong name validation takes place. Em cenários comuns de confiança total, o atributo nunca é considerado, porque as assinaturas de nome forte nunca são validadas.In common full-trust scenarios, the attribute is never considered, because strong name signatures are never validated. No entanto, quando a assinatura de nome forte precisa ser validada, a assinatura de nome forte e a referenda devem ser validadas.However, when the strong name signature does have to be validated, both the strong name signature and the countersignature must be validated. A chave de identidade do assembly não precisa ser idêntica à chave de assinatura (a chave usada para fazer a assinatura e a validação reais).The assembly's identity key does not have to be identical to the signature key (the key used to do the actual signing and validation). A chave de identidade pode ser mapeada para uma chave de assinatura diferente (mais robusta).The identity key can be mapped to a different (more robust) signing key. Isso permite que você defina a identidade de um assembly e atualize as chaves de assinatura e os algoritmos para versões mais seguras.This lets you set the identity of an assembly, and update the signing keys and algorithms to more secure versions.
A referenda lida com questões de segurança quando um assembly mal-intencionado alega alguma outra identidade.The countersignature addresses security concerns when a malicious assembly claims some other identity. Por exemplo, um assembly System.Core.dll mal-intencionado poderia conter a chave pública da Microsoft em seus metadados e usar o atributo para informar a validação de nome forte para usar a chave de assinatura do invasor se nenhuma referenda estiver presente.For example, a malicious System.Core.dll assembly could contain the Microsoft public key in its metadata, and use the attribute to tell strong name validation to use the attacker's signature key if no countersignature is present. Portanto, ele poderia se mascarar como um assembly Microsoft com validação de nome forte.Thus, it could masquerade as a strong name-validated Microsoft assembly.
Para obter informações sobre como assinar assemblies para uso com esse novo atributo, consulte renomeação forte aprimorado.For information about how to sign assemblies for use with this new attribute, see Enhanced Strong Naming.
Construtores
| AssemblySignatureKeyAttribute(String, String) |
Cria uma nova instância da classe AssemblySignatureKeyAttribute usando a chave pública especificada e a referenda.Creates a new instance of the AssemblySignatureKeyAttribute class by using the specified public key and countersignature. |
Propriedades
| Countersignature |
Obtém a referenda do nome forte para esse assembly.Gets the countersignature for the strong name for this assembly. |
| PublicKey |
Obtém a chave pública do nome forte usado para assinar o assembly.Gets the public key for the strong name used to sign the assembly. |
| TypeId |
Quando implementado em uma classe derivada, obtém um identificador exclusivo para este Attribute.When implemented in a derived class, gets a unique identifier for this Attribute. (Herdado de Attribute) |
Métodos
| Equals(Object) |
Retorna um valor que indica se essa instância é igual a um objeto especificado.Returns a value that indicates whether this instance is equal to a specified object. (Herdado de Attribute) |
| GetHashCode() |
Retorna o código hash para a instância.Returns the hash code for this instance. (Herdado de Attribute) |
| GetType() |
Obtém o Type da instância atual.Gets the Type of the current instance. (Herdado de Object) |
| IsDefaultAttribute() |
Quando substituído em uma classe derivada, indica se o valor dessa instância é o valor padrão para a classe derivada.When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. (Herdado de Attribute) |
| Match(Object) |
Quando substituído em uma classe derivada, retorna um valor que indica se essa instância é igual a um objeto especificado.When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Herdado de Attribute) |
| MemberwiseClone() |
Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object. (Herdado de Object) |
| ToString() |
Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object. (Herdado de Object) |
Implantações explícitas de interface
| _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Mapeia um conjunto de nomes para um conjunto correspondente de identificadores de expedição.Maps a set of names to a corresponding set of dispatch identifiers. (Herdado de Attribute) |
| _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) |
Recupera as informações de tipo para um objeto, que pode ser usado para obter as informações de tipo para uma interface.Retrieves the type information for an object, which can be used to get the type information for an interface. (Herdado de Attribute) |
| _Attribute.GetTypeInfoCount(UInt32) |
Retorna o número de interfaces de informações do tipo que um objeto fornece (0 ou 1).Retrieves the number of type information interfaces that an object provides (either 0 or 1). (Herdado de Attribute) |
| _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Fornece acesso a propriedades e métodos expostos por um objeto.Provides access to properties and methods exposed by an object. (Herdado de Attribute) |