值得信赖的是不安全的组件未运行

发布于 2025-01-24 13:31:23 字数 303 浏览 3 评论 0原文

我只是在测试内部的东西,现在可信赖的是安全风险。

  1. 不过,我想知道,如果Trust Worthy是上的,不安全是否可以签署并具有.pfx,请停止工作。其中的密钥文件?
  2. 不确定是在几年前与该证书创建的证书,还是证书或钥匙可以到期?

这个问题与: SQL CLR组装设置为不安全的键不再工作

I am just testing something internal and now the TRUSTWORTHY is set to ON security risks.

  1. I am wondering though, if TRUSTWORTHY is ON, can an UNSAFE assembly stop working if it is signed and and has a .pfx key file in it?
  2. Not sure if a certificate was created with it years ago or either the certificate or key can expire?

This question relates to: A SQL CLR Assembly set to UNSAFE with a key is no longer working

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

待"谢繁草 2025-01-31 13:31:23
  1. 如果trustworthy是上的代码>,则不需要模块签名。

    另外,组件不包含 .pfx 文件。 pfx 文件是一个包含私钥的密码保护文件。一个组件,如果用证书签名(或SNK /非对称密钥),则包含公共密钥,用于验证。< / p>

  2. 不,您不必担心证书的到期日期(尤其是在仅验证已签署的内容时,这就是这里发生的一切)。

    如果您想知道是否已通过强名密钥(SNK) /非对称键签署了一个组件,请查看汇编属性(例如选择名称,clr_name,clr_name from sys.semblies; < / code; < / code < / code >)。如果“ publicKeyToken”(在clr_name中)具有一个值(即不是“ null”),则汇编已被强烈命名(即使用非对称键签名)。

    )。

    如果您想知道是否已通过证书签署了一个组件,只需尝试从该组件创建证书:

     创建证书[_temptest];
     - 删除证书[_temptest];
     

    如果大会已签署了证书,则创建语句将成功。然后,丢弃证书。

    如果没有使用证书签署组件,您将获得以下错误:

      msg 15208,第16级,状态31,行xxxxx
    证书,非对称密钥或专用密钥文件无效或
      不存在;或者您没有权限。
     

    请注意,可以使用非对称键一个或多个证书签署一个组件。

  1. If TRUSTWORTHY is ON, then module signing isn't required.

    Also, assemblies do not contain .pfx files. The pfx file is a password-protected file that contains the private key. An assembly, if signed with a certificate (or snk / asymmetric key), contains the public key, which is used for validation.

  2. No, you needn't worry about the certificate's expiration date (especially not when merely validating something that has been signed, which is all that is happening here).

    If you want to know if an assembly has been signed by a strong-name key (snk) / asymmetric key, just look at the assembly properties (e.g. SELECT name, clr_name FROM sys.assemblies;). If "publickeytoken" (in clr_name) has a value (i.e. not "null"), then the assembly has been strongly-named (i.e. signed with an asymmetric key).

    If you want to know if an assembly has been signed by a certificate, simply try to create a certificate from that assembly:

    CREATE CERTIFICATE [_TempTest] FROM ASSEMBLY [Microsoft.SqlServer.Types];
    -- DROP CERTIFICATE [_TempTest];
    

    If the assembly was signed with a certificate, the CREATE statement will succeed. Then, drop the certificate.

    If the assembly was not signed with a certificate, you will get the following error:

    Msg 15208, Level 16, State 31, Line XXXXX
    The certificate, asymmetric key, or private key file is not valid or
      does not exist; or you do not have permissions for it.
    

    Please note that it is possible to sign an assembly with an asymmetric key and one or more certificates.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文