summaryrefslogtreecommitdiff
path: root/rsa/pem.py
diff options
context:
space:
mode:
authorYesudeep Mangalapilly <yesudeep@gmail.com>2011-08-16 14:30:48 +0530
committerYesudeep Mangalapilly <yesudeep@gmail.com>2011-08-16 14:30:48 +0530
commit03c51e75de8f9969f3fd5f3885a33ef04ce7348a (patch)
tree828db6ba67a52aab6323981fbd7d0bfa5074e605 /rsa/pem.py
parentf9981d28e8ef4a037f6d2598515e425b6c3fef11 (diff)
downloadrsa-git-03c51e75de8f9969f3fd5f3885a33ef04ce7348a.tar.gz
Parellelized testing. Caught a lot of bugs.
Diffstat (limited to 'rsa/pem.py')
-rw-r--r--rsa/pem.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/rsa/pem.py b/rsa/pem.py
index 0875ec3..b632ceb 100644
--- a/rsa/pem.py
+++ b/rsa/pem.py
@@ -14,18 +14,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-'''Functions that load and write PEM-encoded files.'''
+"""Functions that load and write PEM-encoded files."""
import base64
from rsa._compat import b, is_bytes
def _markers(pem_marker):
- '''Returns the start and end PEM markers
+ """Returns the start and end PEM markers
>>> _markers('RSA PRIVATE KEY')
('-----BEGIN RSA PRIVATE KEY-----', '-----END RSA PRIVATE KEY-----')
- '''
+ """
if is_bytes(pem_marker):
pem_marker = pem_marker.decode('utf-8')
@@ -34,7 +34,7 @@ def _markers(pem_marker):
b('-----END %s-----' % pem_marker))
def load_pem(contents, pem_marker):
- '''Loads a PEM file.
+ """Loads a PEM file.
@param contents: the contents of the file to interpret
@param pem_marker: the marker of the PEM content, such as 'RSA PRIVATE KEY'
@@ -46,7 +46,7 @@ def load_pem(contents, pem_marker):
@raise ValueError: when the content is invalid, for example when the start
marker cannot be found.
- '''
+ """
(pem_start, pem_end) = _markers(pem_marker)
@@ -96,7 +96,7 @@ def load_pem(contents, pem_marker):
def save_pem(contents, pem_marker):
- '''Saves a PEM file.
+ """Saves a PEM file.
@param contents: the contents to encode in PEM format
@param pem_marker: the marker of the PEM content, such as 'RSA PRIVATE KEY'
@@ -105,7 +105,7 @@ def save_pem(contents, pem_marker):
@return the base64-encoded content between the start and end markers.
- '''
+ """
(pem_start, pem_end) = _markers(pem_marker)