il2_rest/client.py
def permit_keys(self, keys_to_permit) :
        """
        Add keys to the permitted list for the chain.

        Args:
            keys_to_permit (:obj:`list` of :obj:`il2_rest.models.KeyPermitModel`): List of keys to permitted.

        Returns:
            :obj:`list` of :obj:`il2_rest.models.KeyModel`: Enumerate keys that are currently permitted on chain.
        
        Example:
            >>> node = RestNode(cert_file='mykeymanager.pfx', cert_pass='password', port=32020)
            >>> chain = node.chain_by_id('20ic_KPTCIDfrlwQPKBHdKKp1a6ADaFtBvBjvFmf_fc')
            >>> model_1 = KeyPermitModel(app=4, appActions=[1000, 1001], key_id='Key!MJ0kidltB324mfkiOG0aBlEocPA#SHA1',
            ...               name='documenter', publicKey='PubKey!KPgQEPgItqh<...REDACTED...>BZk4axWhFbTDrxADAQAB#RSA',
            ...               purposes=[KeyPurpose.Action, KeyPurpose.Protocol])
            >>> model_2 = KeyPermitModel(key_id='Key!aWJWFHYDmUXCTCPIW2Ugih5l4XQ#SHA1', name='recorder',
            ...               publicKey='PubKey!KPgQEPgItxD<...REDACTED...>t1RvQCHPYtRADAQAB#RSA',
            ...               purposes=[KeyPurpose.Action, KeyPurpose.Protocol],
            ...               permissions=[AppPermissions(appId=1, actionIds=[300,301,306,302,304,303,305,307])])
            >>> keys = chain.permit_keys([model_1, model_2])
            >>> for key in keys :
            ...     print(keys)
            ...
            Key 'documenter' Key!MJ0kidltB324mfkiOG0aBlEocPA#SHA1
                Purposes: [Action,Protocol]
                Actions permitted:
                  App #4 Actions 1000,1001
            Key 'recorder' Key!aWJWFHYDmUXCTCPIW2Ugih5l4XQ#SHA1
                Purposes: [Action,Protocol]
                Actions permitted:
                  App #1 Actions 300,301,306,302,304,303,305,307 
            Key 'mykeymanager' Key!-u07iGMWlkUm3WVBqS867AI-Lbw#SHA1
                Purposes: [KeyManagement,Action,Protocol]
                Actions permitted:
                  App #2 Actions 500,501
            Key 'emergency!20ic_KPTCIDfrlwQPKBHdKKp1a6ADaFtBvBjvFmf_fc' Key!vckqYtMYIcetbunEJc4w-whbnqtZc9a9qlNp5PePm2E
                Purposes: [Protocol,Action]
                Actions permitted:
                  App #0 Action 131
            Key 'manager!20ic_KPTCIDfrlwQPKBHdKKp1a6ADaFtBvBjvFmf_fc' Key!hLZkEjBRofw1U-JRkXfFdtBWfyM4sZNx8L3R5acakb4
                Purposes: [Protocol,Action,KeyManagement]
                Actions permitted:
                  App #2 Actions 500,501
                  App #1 Actions 300,301       
        """
        json_data = self.__rest._post(f"/chain/{self.id}/key", keys_to_permit)
        return [KeyModel.from_json(item) for item in json_data]

        Add keys to the permitted list for the chain.

        Args:
            keys_to_permit (:obj:`list` of :obj:`il2_rest.models.KeyPermitModel`): List of keys to permitted.

        Returns:
            :obj:`list` of :obj:`il2_rest.models.KeyModel`: Enumerate keys that are currently permitted on chain.
        
        Example:
            >>> node = RestNode(cert_file='mykeymanager.pfx', cert_pass='password', port=32020)
            >>> chain = node.chain_by_id('20ic_KPTCIDfrlwQPKBHdKKp1a6ADaFtBvBjvFmf_fc')
            >>> model_1 = KeyPermitModel(app=4, appActions=[1000, 1001], key_id='Key!MJ0kidltB324mfkiOG0aBlEocPA#SHA1',
            ...               name='documenter', publicKey='PubKey!KPgQEPgItqh<...REDACTED...>BZk4axWhFbTDrxADAQAB#RSA',
            ...               purposes=[KeyPurpose.Action, KeyPurpose.Protocol])
            >>> model_2 = KeyPermitModel(key_id='Key!aWJWFHYDmUXCTCPIW2Ugih5l4XQ#SHA1', name='recorder',
            ...               publicKey='PubKey!KPgQEPgItxD<...REDACTED...>t1RvQCHPYtRADAQAB#RSA',
            ...               purposes=[KeyPurpose.Action, KeyPurpose.Protocol],
            ...               permissions=[AppPermissions(appId=1, actionIds=[300,301,306,302,304,303,305,307])])
            >>> keys = chain.permit_keys([model_1, model_2])
            >>> for key in keys :
            ...     print(keys)
            ...
            Key 'documenter' Key!MJ0kidltB324mfkiOG0aBlEocPA#SHA1
                Purposes: [Action,Protocol]
                Actions permitted:
                  App #4 Actions 1000,1001
            Key 'recorder' Key!aWJWFHYDmUXCTCPIW2Ugih5l4XQ#SHA1
                Purposes: [Action,Protocol]
                Actions permitted:
                  App #1 Actions 300,301,306,302,304,303,305,307 
            Key 'mykeymanager' Key!-u07iGMWlkUm3WVBqS867AI-Lbw#SHA1
                Purposes: [KeyManagement,Action,Protocol]
                Actions permitted:
                  App #2 Actions 500,501
            Key 'emergency!20ic_KPTCIDfrlwQPKBHdKKp1a6ADaFtBvBjvFmf_fc' Key!vckqYtMYIcetbunEJc4w-whbnqtZc9a9qlNp5PePm2E
                Purposes: [Protocol,Action]
                Actions permitted:
                  App #0 Action 131
            Key 'manager!20ic_KPTCIDfrlwQPKBHdKKp1a6ADaFtBvBjvFmf_fc' Key!hLZkEjBRofw1U-JRkXfFdtBWfyM4sZNx8L3R5acakb4
                Purposes: [Protocol,Action,KeyManagement]
                Actions permitted:
                  App #2 Actions 500,501
                  App #1 Actions 300,301       
        
Add keys to the permitted list for the chain.
Add keys to the permitted list for the chain .
def permit_keys(self, keys_to_permit) :
        json_data = self.__rest._post(f"/chain/{self.id}/key", keys_to_permit)
        return [KeyModel.from_json(item) for item in json_data]
def permit_keys ( self , keys_to_permit ) : json_data = self . __rest . _post ( f"/chain/{self.id}/key" , keys_to_permit ) return [ KeyModel . from_json ( item ) for item in json_data ]
Add keys to the permitted list for the chain.
Add keys to the permitted list for the chain .
"""
        Add keys to the permitted list for the chain.

        Args:
            keys_to_permit (:obj:`list` of :obj:`il2_rest.models.KeyPermitModel`): List of keys to permitted.

        Returns:
            :obj:`list` of :obj:`il2_rest.models.KeyModel`: Enumerate keys that are currently permitted on chain.
        
        Example:
            >>> node = RestNode(cert_file='mykeymanager.pfx', cert_pass='password', port=32020)
            >>> chain = node.chain_by_id('20ic_KPTCIDfrlwQPKBHdKKp1a6ADaFtBvBjvFmf_fc')
            >>> model_1 = KeyPermitModel(app=4, appActions=[1000, 1001], key_id='Key!MJ0kidltB324mfkiOG0aBlEocPA#SHA1',
            ...               name='documenter', publicKey='PubKey!KPgQEPgItqh<...REDACTED...>BZk4axWhFbTDrxADAQAB#RSA',
            ...               purposes=[KeyPurpose.Action, KeyPurpose.Protocol])
            >>> model_2 = KeyPermitModel(key_id='Key!aWJWFHYDmUXCTCPIW2Ugih5l4XQ#SHA1', name='recorder',
            ...               publicKey='PubKey!KPgQEPgItxD<...REDACTED...>t1RvQCHPYtRADAQAB#RSA',
            ...               purposes=[KeyPurpose.Action, KeyPurpose.Protocol],
            ...               permissions=[AppPermissions(appId=1, actionIds=[300,301,306,302,304,303,305,307])])
            >>> keys = chain.permit_keys([model_1, model_2])
            >>> for key in keys :
            ...     print(keys)
            ...
            Key 'documenter' Key!MJ0kidltB324mfkiOG0aBlEocPA#SHA1
                Purposes: [Action,Protocol]
                Actions permitted:
                  App #4 Actions 1000,1001
            Key 'recorder' Key!aWJWFHYDmUXCTCPIW2Ugih5l4XQ#SHA1
                Purposes: [Action,Protocol]
                Actions permitted:
                  App #1 Actions 300,301,306,302,304,303,305,307 
            Key 'mykeymanager' Key!-u07iGMWlkUm3WVBqS867AI-Lbw#SHA1
                Purposes: [KeyManagement,Action,Protocol]
                Actions permitted:
                  App #2 Actions 500,501
            Key 'emergency!20ic_KPTCIDfrlwQPKBHdKKp1a6ADaFtBvBjvFmf_fc' Key!vckqYtMYIcetbunEJc4w-whbnqtZc9a9qlNp5PePm2E
                Purposes: [Protocol,Action]
                Actions permitted:
                  App #0 Action 131
            Key 'manager!20ic_KPTCIDfrlwQPKBHdKKp1a6ADaFtBvBjvFmf_fc' Key!hLZkEjBRofw1U-JRkXfFdtBWfyM4sZNx8L3R5acakb4
                Purposes: [Protocol,Action,KeyManagement]
                Actions permitted:
                  App #2 Actions 500,501
                  App #1 Actions 300,301       
        """
:obj:`list` of :obj:`il2_rest.models.KeyModel`: Enumerate keys that are currently permitted on chain.
: obj : ` list ` of : obj : ` il2_rest . models . KeyModel ` : Enumerate keys that are currently permitted on chain .
self
keys_to_permit
keys_to_permit (
`list` of :obj:`il2_rest.models.KeyPermitModel`): List of keys to permitted.
` list ` of : obj : ` il2_rest . models . KeyPermitModel ` ) : List of keys to permitted .
examples
>>> node = RestNode(cert_file='mykeymanager.pfx', cert_pass='password', port=32020)
>>> chain = node.chain_by_id('20ic_KPTCIDfrlwQPKBHdKKp1a6ADaFtBvBjvFmf_fc')
>>> model_1 = KeyPermitModel(app=4, appActions=[1000, 1001], key_id='Key!MJ0kidltB324mfkiOG0aBlEocPA#SHA1',
name='documenter', publicKey='PubKey!KPgQEPgItqh<...REDACTED...>BZk4axWhFbTDrxADAQAB#RSA',
purposes=[KeyPurpose.Action, KeyPurpose.Protocol])
>>> model_2 = KeyPermitModel(key_id='Key!aWJWFHYDmUXCTCPIW2Ugih5l4XQ#SHA1', name='recorder',
publicKey='PubKey!KPgQEPgItxD<...REDACTED...>t1RvQCHPYtRADAQAB#RSA',
purposes=[KeyPurpose.Action, KeyPurpose.Protocol],
permissions=[AppPermissions(appId=1, actionIds=[300,301,306,302,304,303,305,307])])
>>> keys = chain.permit_keys([model_1, model_2])
>>> for key in keys :
print(keys)

Key 'documenter' Key!MJ0kidltB324mfkiOG0aBlEocPA#SHA1
Purposes: [Action,Protocol]
Actions permitted:
App #4 Actions 1000,1001
Key 'recorder' Key!aWJWFHYDmUXCTCPIW2Ugih5l4XQ#SHA1
Purposes: [Action,Protocol]
Actions permitted:
App #1 Actions 300,301,306,302,304,303,305,307
Key 'mykeymanager' Key!-u07iGMWlkUm3WVBqS867AI-Lbw#SHA1
Purposes: [KeyManagement,Action,Protocol]
Actions permitted:
App #2 Actions 500,501
Key 'emergency!20ic_KPTCIDfrlwQPKBHdKKp1a6ADaFtBvBjvFmf_fc' Key!vckqYtMYIcetbunEJc4w-whbnqtZc9a9qlNp5PePm2E
Purposes: [Protocol,Action]
Actions permitted:
App #0 Action 131
Key 'manager!20ic_KPTCIDfrlwQPKBHdKKp1a6ADaFtBvBjvFmf_fc' Key!hLZkEjBRofw1U-JRkXfFdtBWfyM4sZNx8L3R5acakb4
Purposes: [Protocol,Action,KeyManagement]
Actions permitted:
App #2 Actions 500,501
App #1 Actions 300,301
>>> node = RestNode ( cert_file = ' mykeymanager . pfx ' cert_pass = ' password ' port = 32020 ) >>> chain = node . chain_by_id ( ' 20ic_KPTCIDfrlwQPKBHdKKp1a6ADaFtBvBjvFmf_fc ' ) >>> model_1 = KeyPermitModel ( app = 4 appActions = [ 1000 1001 ] key_id = ' Key!MJ0kidltB324mfkiOG0aBlEocPA#SHA1 ' name = ' documenter ' publicKey = ' PubKey!KPgQEPgItqh< ... REDACTED ... > BZk4axWhFbTDrxADAQAB#RSA ' purposes = [ KeyPurpose . Action KeyPurpose . Protocol ] ) >>> model_2 = KeyPermitModel ( key_id = ' Key!aWJWFHYDmUXCTCPIW2Ugih5l4XQ#SHA1 ' name = ' recorder ' publicKey = ' PubKey!KPgQEPgItxD< ... REDACTED ... > t1RvQCHPYtRADAQAB#RSA ' purposes = [ KeyPurpose . Action KeyPurpose . Protocol ] permissions = [ AppPermissions ( appId = 1 actionIds = [ 300 301 306 302 304 303 305 307 ] ) ] ) >>> keys = chain . permit_keys ( [ model_1 model_2 ] ) >>> for key in keys : print ( keys ) Key ' documenter ' Key!MJ0kidltB324mfkiOG0aBlEocPA#SHA1 Purposes : [ Action Protocol ] Actions permitted : App #4 Actions 1000 1001 Key ' recorder ' Key!aWJWFHYDmUXCTCPIW2Ugih5l4XQ#SHA1 Purposes : [ Action Protocol ] Actions permitted : App #1 Actions 300 301 306 302 304 303 305 307 Key ' mykeymanager ' Key! - u07iGMWlkUm3WVBqS867AI - Lbw#SHA1 Purposes : [ KeyManagement Action Protocol ] Actions permitted : App #2 Actions 500 501 Key ' emergency!20ic_KPTCIDfrlwQPKBHdKKp1a6ADaFtBvBjvFmf_fc ' Key!vckqYtMYIcetbunEJc4w - whbnqtZc9a9qlNp5PePm2E Purposes : [ Protocol Action ] Actions permitted : App #0 Action 131 Key ' manager!20ic_KPTCIDfrlwQPKBHdKKp1a6ADaFtBvBjvFmf_fc ' Key!hLZkEjBRofw1U - JRkXfFdtBWfyM4sZNx8L3R5acakb4 Purposes : [ Protocol Action KeyManagement ] Actions permitted : App #2 Actions 500 501 App #1 Actions 300 301