1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢(xún)
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時(shí)間:8:30-17:00
      你可能遇到了下面的問(wèn)題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
      FabricCA創(chuàng)建用戶(hù)機(jī)制的示例分析

      這篇文章給大家分享的是有關(guān)Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析的內(nèi)容。小編覺(jué)得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨小編過(guò)來(lái)看看吧。

      創(chuàng)新互聯(lián)公司的客戶(hù)來(lái)自各行各業(yè),為了共同目標(biāo),我們?cè)诠ぷ魃厦芮信浜希瑥膭?chuàng)業(yè)型小企業(yè)到企事業(yè)單位,感謝他們對(duì)我們的要求,感謝他們從不同領(lǐng)域給我們帶來(lái)的挑戰(zhàn),讓我們激情的團(tuán)隊(duì)有機(jī)會(huì)用頭腦與智慧不斷的給客戶(hù)帶來(lái)驚喜。專(zhuān)業(yè)領(lǐng)域包括網(wǎng)站建設(shè)、成都網(wǎng)站建設(shè)、電商網(wǎng)站開(kāi)發(fā)、微信營(yíng)銷(xiāo)、系統(tǒng)平臺(tái)開(kāi)發(fā)。

      在研究Fabric CA 創(chuàng)建用戶(hù),的時(shí)候發(fā)現(xiàn)很多隱含規(guī)則

      通過(guò)官方文檔,我們知道 fabric-ca 可以帶有如下幾個(gè)以hf.開(kāi)頭的屬性,我們暫且稱(chēng)之為系統(tǒng)屬性

      NameTypeDescription
      hf.Registrar.RolesListList of roles that the registrar is allowed to manage
      hf.Registrar.DelegateRolesListList of roles that the registrar is allowed to give to a registree for its ‘hf.Registrar.Roles’ attribute
      hf.Registrar.AttributesListList of attributes that registrar is allowed to register
      hf.GenCRLBooleanIdentity is able to generate CRL if attribute value is true
      hf.RevokerBooleanIdentity is able to revoke a user and/or certificates if attribute value is true
      hf.AffiliationMgrBooleanIdentity is able to manage affiliations if attribute value is true
      hf.IntermediateCABooleanIdentity is able to enroll as an intermediate CA if attribute value is true

      現(xiàn)象一:Boolean類(lèi)型系統(tǒng)屬性

      首先,我們用admin創(chuàng)建賬戶(hù)test_a,

      Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析

      命令如下:

      fabric-ca-client register -d \
      --id.name test_a \
      --id.secret test_a_pw \
      --id.type client \
      --id.affiliation easypay.fabric \
      --id.attrs '"hf.Registrar.Roles=client,user"' \
      --id.attrs '"hf.Registrar.DelegateRoles=client,user"' \
      --id.attrs '"hf.Registrar.Attributes=*"' \
      --id.attrs hf.Revoker=true \
      --id.attrs hf.AffiliationMgr=true \
      --id.attrs hf.IntermediateCA=true \
      --id.attrs hf.GenCRL=false

      即,設(shè)置test_a用戶(hù)hf.GenCRL=false,結(jié)果如下:

      Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析

      然后我們嘗試用test_a賬戶(hù)分別創(chuàng)建以下幾個(gè)賬戶(hù)(注意是用test_a賬戶(hù),而不是admin賬戶(hù))

      • test_a_a,設(shè)置test_a_a用戶(hù)hf.GenCRL=true:

      fabric-ca-client register -d \
      --id.name test_a_a \
      --id.secret test_a_a_pw \
      --id.type client \
      --id.affiliation easypay.fabric \
      --id.attrs '"hf.Registrar.Roles=client,user"' \
      --id.attrs '"hf.Registrar.DelegateRoles=client,user"' \
      --id.attrs '"hf.Registrar.Attributes=*"' \
      --id.attrs hf.Revoker=true \
      --id.attrs hf.AffiliationMgr=true \
      --id.attrs hf.IntermediateCA=true \
      --id.attrs hf.GenCRL=true

      結(jié)果創(chuàng)建失敗,會(huì)報(bào)權(quán)限錯(cuò)誤,如下所示:

      Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析

      • test_a_b,設(shè)置test_a_b用戶(hù)hf.GenCRL=false:

      fabric-ca-client register -d \
      --id.name test_a_b \
      --id.secret test_a_b_pw \
      --id.type client \
      --id.affiliation easypay.fabric \
      --id.attrs '"hf.Registrar.Roles=client,user"' \
      --id.attrs '"hf.Registrar.DelegateRoles=client,user"' \
      --id.attrs '"hf.Registrar.Attributes=*"' \
      --id.attrs hf.Revoker=true \
      --id.attrs hf.AffiliationMgr=true \
      --id.attrs hf.IntermediateCA=true \
      --id.attrs hf.GenCRL=false

      結(jié)果同上:

      Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析

      • test_a_c,不設(shè)置test_a_c用戶(hù)hf.GenCRL屬性:

      fabric-ca-client register -d \
      --id.name test_a_c \
      --id.secret test_a_c_pw \
      --id.type client \
      --id.affiliation easypay.fabric \
      --id.attrs '"hf.Registrar.Roles=client,user"' \
      --id.attrs '"hf.Registrar.DelegateRoles=client,user"' \
      --id.attrs '"hf.Registrar.Attributes=*"' \
      --id.attrs hf.Revoker=true \
      --id.attrs hf.AffiliationMgr=true \
      --id.attrs hf.IntermediateCA=true

      結(jié)果創(chuàng)建成功,如下:

      Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析

      其他幾個(gè)布爾類(lèi)型屬性,hf.Revoker,hf.AffiliationMgr,hf.IntermediateCA,都有類(lèi)似現(xiàn)象,即,上級(jí)id這些布爾屬性如果設(shè)置為false(或者不設(shè)置),則所創(chuàng)建是下級(jí)id都不能帶有對(duì)應(yīng)的這個(gè)幾個(gè)布爾類(lèi)型的系統(tǒng)屬性

      現(xiàn)象二:hf.Registrar.Roles的約束

      剛才創(chuàng)建的test_a身份,id.type=client ,hf.Registrar.Roles=client,user, 如果我們用test_a注冊(cè)一個(gè)id.type=peer或者id.type=orderer的身份 結(jié)果會(huì)怎樣呢?大家應(yīng)該都想得到,肯定是失敗,這里我就不做測(cè)試了

      備注:fabric-ca 1.1 版本 hf.Registrar.Roles 屬性只支持client,user,peer,orderer四種,1.2版本即將支持自定義角色,詳見(jiàn):https://jira.hyperledger.org/browse/FAB-7882

      相關(guān)資料截圖:

      Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析

      Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析

      Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析

      Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析

      Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析

      用 test_a 用戶(hù)創(chuàng)建一個(gè) test_a_d身份,設(shè)置test_a_d屬性hf.Registrar.Roles=client,user,peer ,如下:

      fabric-ca-client register -d \
      --id.name test_a_d \
      --id.secret test_a_d_pw \
      --id.type client \
      --id.affiliation easypay.fabric \
      --id.attrs '"hf.Registrar.Roles=client,user,peer"' \
      --id.attrs '"hf.Registrar.DelegateRoles=client,user,peer"' \
      --id.attrs '"hf.Registrar.Attributes=*"' \
      --id.attrs hf.Revoker=true \
      --id.attrs hf.AffiliationMgr=true \
      --id.attrs hf.IntermediateCA=true

      結(jié)果創(chuàng)建失敗,如下:

      Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析

      可以繼續(xù)往下測(cè)試,可以發(fā)現(xiàn),當(dāng)test_a身份的屬性hf.Registrar.Roles=client,user ,往下用test_a身份創(chuàng)建的子身份的f.Registrar.Roles屬性值都不能超過(guò)client,user的范圍

      再用 test_a 用戶(hù)創(chuàng)建一個(gè) test_a_e身份,設(shè)置test_a_e 屬性id.type=peer ,如下:

      fabric-ca-client register -d \
      --id.name test_a_e \
      --id.secret test_a_e_pw \
      --id.type peer \
      --id.affiliation easypay.fabric \
      --id.attrs '"hf.Registrar.Roles=client,user"' \
      --id.attrs '"hf.Registrar.DelegateRoles=client,user"' \
      --id.attrs '"hf.Registrar.Attributes=*"' \
      --id.attrs hf.Revoker=true \
      --id.attrs hf.AffiliationMgr=true \
      --id.attrs hf.IntermediateCA=true

      結(jié)果創(chuàng)建失敗,錯(cuò)誤信息如下:

      Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析

      子 id 的id.type屬性值也受到上級(jí)id的hf.Registrar.Roles屬性值的約束

      現(xiàn)象三:hf.Registrar.Attributes 屬性的約束

      嘗試用 admin 身份 創(chuàng)建 test_b ,添加hf.key=value

      fabric-ca-client register -d \
      --id.name test_b \
      --id.secret test_b_pw \
      --id.type client \
      --id.attrs hf.key=value

      即使admin身份hf.Registrar.Attributes=*,還是創(chuàng)建失敗,結(jié)果如圖

      Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析

      再?lài)L試用 admin 身份 創(chuàng)建 test_c,添加hf=value

      fabric-ca-client register -d \
      --id.name test_c \
      --id.secret test_c_pw \
      --id.type client \
      --id.attrs hf=value

      創(chuàng)建成功,結(jié)果如圖

      Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析

      總結(jié)下來(lái),有以下幾點(diǎn)規(guī)律:

      1. 上級(jí)id的hf.Registrar.Attributes值可以約束它所創(chuàng)建的子級(jí)id能添加的屬性,但是帶hf.的除外,帶hf.開(kāi)頭的會(huì)被當(dāng)做系統(tǒng)屬性,區(qū)別對(duì)待

      2. 從上級(jí)往下,所帶的屬性約束只能是逐漸收斂的,不能發(fā)散

      相關(guān)代碼

      感興趣可以詳細(xì)研究一下源代碼 相關(guān)部分代碼可以參見(jiàn):https://github.com/hyperledger/fabric-ca/blob/release-1.1/lib/attr/attribute.go

      Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析 Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析

      感謝各位的閱讀!關(guān)于“Fabric CA創(chuàng)建用戶(hù)機(jī)制的示例分析”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,讓大家可以學(xué)到更多知識(shí),如果覺(jué)得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!


      分享文章:FabricCA創(chuàng)建用戶(hù)機(jī)制的示例分析
      文章源于:http://www.ef60e0e.cn/article/gdgggs.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        曲麻莱县| 黑水县| 双城市| 庄河市| 鹤岗市| 林芝县| 文登市| 都匀市| 洪江市| 伊吾县| 南澳县| 临沭县| 若尔盖县| 内丘县| 尖扎县| 洛阳市| 新巴尔虎右旗| 云安县| 岳阳市| 富阳市| 金川县| 贵港市| 左云县| 上蔡县| 旬邑县| 杭锦后旗| 海林市| 樟树市| 平武县| 治多县| 尖扎县| 泰州市| 迁安市| 滦平县| 南木林县| 永和县| 绥德县| 西丰县| 邻水| 保德县| 三门县|