python-nss-docs/nss.nss.PK11Slot-class.html

1293 строки
46 KiB
HTML

<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>nss.nss.PK11Slot</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="nss-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<th class="navbar" width="100%"></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="nss-module.html">Package&nbsp;nss</a> ::
<a href="nss.nss-module.html">Module&nbsp;nss</a> ::
Class&nbsp;PK11Slot
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>]&nbsp;|&nbsp;<a href="nss.nss.PK11Slot-class.html"
target="_top">no&nbsp;frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<!-- ==================== TYPE DESCRIPTION ==================== -->
<h1 class="epydoc">type PK11Slot</h1><p class="nomargin-top"></p>
<pre class="base-tree">
object --+
|
<strong class="uidshort">PK11Slot</strong>
</pre>
<hr />
An object representing a PKCS #11 Slot
<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Instance Methods</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-InstanceMethods"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">...</span>)</span><br />
x.__init__(...) initializes x; see help(type(x)) for signature</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">a new object with type S, a subtype of T</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#__new__" class="summary-sig-name">__new__</a>(<span class="summary-sig-arg">T</span>,
<span class="summary-sig-arg">S</span>,
<span class="summary-sig-arg">...</span>)</span></td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#__str__" class="summary-sig-name">__str__</a>(<span class="summary-sig-arg">x</span>)</span><br />
str(x)</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type"><table class="rst-docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="rst-field"><th class="rst-field-name">Parameters:</th><td class="rst-field-body"></td>
</tr>
</tbody>
</table></span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#authenticate" class="summary-sig-name">authenticate</a>(<span class="summary-sig-arg">load_certs</span>=<span class="summary-sig-default">False</span>,
<span class="summary-sig-arg">user_data1</span>=<span class="summary-sig-default">...</span>,
<span class="summary-sig-arg">...</span>)</span><br />
If True load certificates after authenticating.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#change_passwd" class="summary-sig-name">change_passwd</a>(<span class="summary-sig-arg">old_passwd</span>=<span class="summary-sig-default">None</span>,
<span class="summary-sig-arg">new_passwd</span>=<span class="summary-sig-default">None</span>)</span><br />
Change the user password on the token.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">bool</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#check_security_officer_passwd" class="summary-sig-name">check_security_officer_passwd</a>(<span class="summary-sig-arg">security_officer_passwd</span>)</span><br />
Verify security officer password.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#check_user_passwd" class="summary-sig-name">check_user_passwd</a>(<span class="summary-sig-arg">user_passwd</span>)</span><br />
Verify security officer password.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">string)</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#format" class="summary-sig-name">format</a>(<span class="summary-sig-arg">level</span>=<span class="summary-sig-default">0</span>,
<span class="summary-sig-arg">indent</span>=<span class="summary-sig-default">' '</span>)</span><br />
This is equivalent to:
indented_format(obj.format_lines()) on an object providing a format_lines() method.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">[(level, string),...]</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#format_lines" class="summary-sig-name">format_lines</a>(<span class="summary-sig-arg">level</span>=<span class="summary-sig-default">0</span>)</span><br />
Formats the object into a sequence of lines with indent level
information.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#generate_key_pair" class="summary-sig-name">generate_key_pair</a>(<span class="summary-sig-arg">...</span>)</span><br />
generate_key_pair(mechanism, key_params, token, sensitive, [user_data1, ...]) -&gt; public_key, private_key</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">length</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#get_best_key_length" class="summary-sig-name">get_best_key_length</a>(<span class="summary-sig-arg">mechanism</span>)</span><br />
Return the best key length for this slot and mechanism.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">mechanism</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="get_best_wrap_mechanism"></a><span class="summary-sig-name">get_best_wrap_mechanism</span>()</span><br />
Find the best key wrap mechanism for this slot.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">integer</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#get_disabled_reason" class="summary-sig-name">get_disabled_reason</a>()</span><br />
Returns a diabled reason enumerated constant (i.e.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">bool</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#has_protected_authentication_path" class="summary-sig-name">has_protected_authentication_path</a>()</span><br />
Returns True if token has a &quot;protected authentication path&quot;, whereby
a user can log into the token without passing a PIN through the
library, False otherwise.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">bool</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="has_root_certs"></a><span class="summary-sig-name">has_root_certs</span>()</span><br />
Returns True if the slot contains the root certificate , False otherwise.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#init_pin" class="summary-sig-name">init_pin</a>(<span class="summary-sig-arg">security_officer_passwd</span>=<span class="summary-sig-default">None</span>,
<span class="summary-sig-arg">user_passwd</span>=<span class="summary-sig-default">None</span>)</span><br />
Initialize the token's pin for first use.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">bool</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="is_disabled"></a><span class="summary-sig-name">is_disabled</span>()</span><br />
Returns True if the slot is disabled, False otherwise.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">bool</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="is_friendly"></a><span class="summary-sig-name">is_friendly</span>()</span><br />
Returns True if the slot allows certificates to be read
without logging in to the token, False otherwise.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">bool</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="is_hw"></a><span class="summary-sig-name">is_hw</span>()</span><br />
Returns True if the slot is implemented in hardware, False otherwise.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">bool</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="is_internal"></a><span class="summary-sig-name">is_internal</span>()</span><br />
Returns True if the the slot is internal, False otherwise.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">bool</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#is_logged_in" class="summary-sig-name">is_logged_in</a>(<span class="summary-sig-arg">user_data1</span>=<span class="summary-sig-default">...</span>,
<span class="summary-sig-arg">...</span>)</span><br />
Return True if token is logged in, False otherwise.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">bool</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="is_present"></a><span class="summary-sig-name">is_present</span>()</span><br />
Returns True if the slot's token present, False otherwise.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">bool</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="is_read_only"></a><span class="summary-sig-name">is_read_only</span>()</span><br />
Returns True if the the slot is read-only, False otherwise.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">bool</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="is_removable"></a><span class="summary-sig-name">is_removable</span>()</span><br />
Returns True if the token is removable, False otherwise.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#key_gen" class="summary-sig-name">key_gen</a>(<span class="summary-sig-arg">...</span>)</span><br />
key_gen(mechanism, sec_param, key_size, [user_data1, ...]) -&gt; PK11SymKey object</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">(<a href="nss.nss.Certificate-class.html" class="link">Certificate</a>, ...)</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="list_certs"></a><span class="summary-sig-name">list_certs</span>()</span><br />
Returns a tuple of <a href="nss.nss.Certificate-class.html" class="link">Certificate</a> objects found in the slot.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#logout" class="summary-sig-name">logout</a>(<span class="summary-sig-arg">...</span>)</span><br />
logout()l</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">bool</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="need_login"></a><span class="summary-sig-name">need_login</span>()</span><br />
Returns True if there are some cryptographic functions that a
user must be logged in to perform, False otherwise.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">bool</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a name="need_user_init"></a><span class="summary-sig-name">need_user_init</span>()</span><br />
Returns True if the slot needs to be logged into by
the user by providing their pin, False otherwise.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#pbe_key_gen" class="summary-sig-name">pbe_key_gen</a>(<span class="summary-sig-arg">...</span>)</span><br />
pbe_key_gen(algid, password, [user_data1, ...]) -&gt; PK11SymKey object</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#user_disable" class="summary-sig-name">user_disable</a>()</span><br />
Prevents the slot from being used, and sets disable reason to
PK11_DIS_USER_SELECTED.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="nss.nss.PK11Slot-class.html#user_enable" class="summary-sig-name">user_enable</a>()</span><br />
Allow all mechanisms that are ON before <a href="nss.nss.PK11Slot-class.html#user_disable" class="link">PK11Slot.user\_disable()</a> was
called to be available again.</td>
<td align="right" valign="top">
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Properties</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-Properties"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a name="slot_name"></a><span class="summary-name">slot_name</span><br />
slot name
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a name="token_name"></a><span class="summary-name">token_name</span><br />
token name
</td>
</tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td colspan="2" class="table-header">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td align="left"><span class="table-header">Method Details</span></td>
<td align="right" valign="top"
><span class="options">[<a href="#section-MethodDetails"
class="privatelink" onclick="toggle_private();"
>hide private</a>]</span></td>
</tr>
</table>
</td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">...</span>)</span>
<br /><em class="fname">(Constructor)</em>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
x.__init__(...) initializes x; see help(type(x)) for signature
<dl class="fields">
<dt>Overrides:
object.__init__
</dt>
</dl>
</td></tr></table>
</div>
<a name="__new__"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>,
<span class="sig-arg">S</span>,
<span class="sig-arg">...</span>)</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
<dl class="fields">
<dt>Returns: a new object with type S, a subtype of T</dt>
<dt>Overrides:
object.__new__
</dt>
</dl>
</td></tr></table>
</div>
<a name="__str__"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">x</span>)</span>
<br /><em class="fname">(Informal representation operator)</em>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
str(x)
<dl class="fields">
<dt>Overrides:
object.__str__
</dt>
</dl>
</td></tr></table>
</div>
<a name="authenticate"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">authenticate</span>(<span class="sig-arg">load_certs</span>=<span class="sig-default">False</span>,
<span class="sig-arg">user_data1</span>=<span class="sig-default">...</span>,
<span class="sig-arg">...</span>)</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
<blockquote>
<dl class="rst-docutils">
<dt>load_certs <span class="classifier-delimiter">:</span> <span class="rst-classifier">bool</span></dt>
<dd>If True load certificates after authenticating.</dd>
</dl>
</blockquote>
<p>Checks to see if token needs to be logged in. If so it invokes the
password callback (set via <a href="nss.nss-module.html#set_password_callback" class="link">nss.set\_password\_callback()</a>) passing the
optional user_data parameters to the password callback.</p>
<dl class="fields">
<dt>Returns: <table class="rst-docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="rst-field"><th class="rst-field-name">Parameters:</th><td class="rst-field-body"></td>
</tr>
</tbody>
</table></dt>
</dl>
</td></tr></table>
</div>
<a name="change_passwd"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">change_passwd</span>(<span class="sig-arg">old_passwd</span>=<span class="sig-default">None</span>,
<span class="sig-arg">new_passwd</span>=<span class="sig-default">None</span>)</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
Change the user password on the token.
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>old_passwd</code></strong> (string or None) - Previouis password.</li>
<li><strong class="pname"><code>new_passwd</code></strong> (string or None) - New password.</li>
</ul></dd>
</dl>
</td></tr></table>
</div>
<a name="check_security_officer_passwd"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">check_security_officer_passwd</span>(<span class="sig-arg">security_officer_passwd</span>)</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
Verify security officer password.
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>security_officer_passwd</code></strong> (string) - Security Officer password.</li>
</ul></dd>
<dt>Returns: bool</dt>
</dl>
</td></tr></table>
</div>
<a name="check_user_passwd"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">check_user_passwd</span>(<span class="sig-arg">user_passwd</span>)</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
Verify security officer password.
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>user_passwd</code></strong> (string) - user password.</li>
</ul></dd>
</dl>
</td></tr></table>
</div>
<a name="format"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">format</span>(<span class="sig-arg">level</span>=<span class="sig-default">0</span>,
<span class="sig-arg">indent</span>=<span class="sig-default">' '</span>)</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
This is equivalent to:
indented_format(obj.format_lines()) on an object providing a format_lines() method.
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>level</code></strong> (integer) - Initial indentation level, all subsequent indents are relative
to this starting level.</li>
<li><strong class="pname"><code>indent</code></strong> (string) - string replicated once for each indent level then prepended to output line</li>
</ul></dd>
<dt>Returns: string)</dt>
</dl>
</td></tr></table>
</div>
<a name="format_lines"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">format_lines</span>(<span class="sig-arg">level</span>=<span class="sig-default">0</span>)</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
<p>Formats the object into a sequence of lines with indent level
information. The return value is a list where each list item is a
tuple. The first item in the tuple is an integer
representing the indentation level for that line. Any remaining items
in the tuple are strings to be output on that line.</p>
<p>The output of this function can be formatted into a single string by
calling <a href="nss.nss-module.html#indented_format" class="link">nss.nss.indented\_format()</a>, e.g.:</p>
<blockquote>
print indented_format(obj.format_lines())</blockquote>
<p>The reason this function returns a tuple as opposed to an single
indented string is to support other text formatting systems such as
GUI's with indentation controls. See <a href="nss.nss-module.html#indented_format" class="link">nss.nss.indented\_format()</a> for a
complete explanation.</p>
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>level</code></strong> (integer) - Initial indentation level, all subsequent indents are relative
to this starting level.</li>
</ul></dd>
<dt>Returns: [(level, string),...]</dt>
</dl>
</td></tr></table>
</div>
<a name="generate_key_pair"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">generate_key_pair</span>(<span class="sig-arg">...</span>)</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
<p>generate_key_pair(mechanism, key_params, token, sensitive, [user_data1, ...]) -&gt; public_key, private_key</p>
<p>Generate a public and private key pair.</p>
<p>Example:</p>
<pre class="rst-literal-block">
# Generate a DSA key pair
key_params = nss.KEYPQGParams()
mechanism = nss.CKM_DSA_KEY_PAIR_GEN
slot = nss.get_best_slot(mechanism)
pub_key, priv_key = slot.generate_key_pair(mechanism, key_params, False, False)
# Generate a DSA key pair
key_params = nss.RSAGenParams()
mechanism = nss.CKM_RSA_PKCS_KEY_PAIR_GEN
slot = nss.get_best_slot(mechanism)
pub_key, priv_key = slot.generate_key_pair(mechanism, key_params, False, False)
</pre>
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>mechanism</code></strong> (int) - key mechanism enumeration constant (CKM_*)</li>
<li><strong class="pname"><code>key_params</code></strong> (SecItem object or None) - SecItem key parameters. None is also valid.</li>
<li><strong class="pname"><code>token</code></strong> (bool) - If true the key is a token object otherwise it's a session object.</li>
<li><strong class="pname"><code>sensitive</code></strong> (bool) - If a key is sensitive, certain attributes of the key cannot be
revealed in plaintext outside the token. It is also more
expensive to move between tokens.</li>
<li><strong class="pname"><code>user_dataN</code></strong> (object ...) - zero or more caller supplied parameters which will
be passed to the password callback function</li>
</ul></dd>
</dl>
</td></tr></table>
</div>
<a name="get_best_key_length"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">get_best_key_length</span>(<span class="sig-arg">mechanism</span>)</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
Return the best key length for this slot and mechanism.
A zero result means that token knows how long the key should be,
the result is typically used with key_gen(), token_key_gen(), or
token_key_gen_with_flags()
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>mechanism</code></strong> (int) - key mechanism enumeration constant (CKM_*)</li>
</ul></dd>
<dt>Returns: length</dt>
</dl>
</td></tr></table>
</div>
<a name="get_disabled_reason"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">get_disabled_reason</span>()</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
<p>Returns a diabled reason enumerated constant (i.e. PK11_DIS_*).</p>
<p>May be one of:</p>
<blockquote>
<ul class="rst-simple">
<li>PK11_DIS_NONE</li>
<li>PK11_DIS_USER_SELECTED</li>
<li>PK11_DIS_COULD_NOT_INIT_TOKEN</li>
<li>PK11_DIS_TOKEN_VERIFY_FAILED</li>
<li>PK11_DIS_TOKEN_NOT_PRESENT</li>
</ul>
</blockquote>
<dl class="fields">
<dt>Returns: integer</dt>
</dl>
</td></tr></table>
</div>
<a name="has_protected_authentication_path"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">has_protected_authentication_path</span>()</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
Returns True if token has a &quot;protected authentication path&quot;, whereby
a user can log into the token without passing a PIN through the
library, False otherwise. An example might be a token with an
integrated key pad.
<dl class="fields">
<dt>Returns: bool</dt>
</dl>
</td></tr></table>
</div>
<a name="init_pin"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">init_pin</span>(<span class="sig-arg">security_officer_passwd</span>=<span class="sig-default">None</span>,
<span class="sig-arg">user_passwd</span>=<span class="sig-default">None</span>)</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
Initialize the token's pin for first use.
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>security_officer_passwd</code></strong> (string or None) - Security Officer password used to unlock token.</li>
<li><strong class="pname"><code>user_passwd</code></strong> (string or None) - User password to set as token pin.</li>
</ul></dd>
</dl>
</td></tr></table>
</div>
<a name="is_logged_in"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">is_logged_in</span>(<span class="sig-arg">user_data1</span>=<span class="sig-default">...</span>,
<span class="sig-arg">...</span>)</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
Return True if token is logged in, False otherwise.
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>user_data1</code></strong> (object ...) - zero or more caller supplied parameters which will
be passed to the password callback function</li>
</ul></dd>
<dt>Returns: bool</dt>
</dl>
</td></tr></table>
</div>
<a name="key_gen"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">key_gen</span>(<span class="sig-arg">...</span>)</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
<p>key_gen(mechanism, sec_param, key_size, [user_data1, ...]) -&gt; PK11SymKey object</p>
<p>Generate a symmetric key.</p>
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>mechanism</code></strong> (int) - key mechanism enumeration constant (CKM_*)</li>
<li><strong class="pname"><code>sec_param</code></strong> (SecItem object or None) - SecItem key parameters. None is also valid.</li>
<li><strong class="pname"><code>key_size</code></strong> (int) - key length (use get_best_key_length())</li>
<li><strong class="pname"><code>user_dataN</code></strong> (object ...) - zero or more caller supplied parameters which will
be passed to the password callback function</li>
</ul></dd>
</dl>
</td></tr></table>
</div>
<a name="logout"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">logout</span>(<span class="sig-arg">...</span>)</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
<p>logout()l</p>
<p>Logs a user out of a session destroying any objects
allocated on their behalf.</p>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="pbe_key_gen"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">pbe_key_gen</span>(<span class="sig-arg">...</span>)</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
<p>pbe_key_gen(algid, password, [user_data1, ...]) -&gt; PK11SymKey object</p>
<p>Generate a PBE symmetric key.</p>
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>algid</code></strong> (AlgorithmID object) - algorithm id</li>
<li><strong class="pname"><code>password</code></strong> (string) - the password used to create the PBE Key</li>
<li><strong class="pname"><code>user_dataN</code></strong> (object ...) - zero or more caller supplied parameters which will
be passed to the password callback function</li>
</ul></dd>
</dl>
</td></tr></table>
</div>
<a name="user_disable"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">user_disable</span>()</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
<p>Prevents the slot from being used, and sets disable reason to
PK11_DIS_USER_SELECTED.</p>
<p>Mechanisms that were on continue to stay on. Therefore, when the slot
is enabled again via <a href="nss.nss.PK11Slot-class.html#user_enable" class="link">PK11Slot.user\_enable()</a>, it will remember what
mechanisms needs to be turned on.</p>
<dl class="fields">
</dl>
</td></tr></table>
</div>
<a name="user_enable"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">user_enable</span>()</span>
</h3>
</td><td align="right" valign="top"
>&nbsp;
</td>
</tr></table>
Allow all mechanisms that are ON before <a href="nss.nss.PK11Slot-class.html#user_disable" class="link">PK11Slot.user\_disable()</a> was
called to be available again. Sets disable reason to PK11_DIS_NONE.
<dl class="fields">
</dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="nss-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<th class="navbar" width="100%"></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
>http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>