partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
valid
BroadcastQueue._get_or_create_subscription
In a broadcast queue, workers have a unique subscription ensuring that every worker recieves a copy of every task.
psq/broadcast_queue.py
def _get_or_create_subscription(self): """In a broadcast queue, workers have a unique subscription ensuring that every worker recieves a copy of every task.""" topic_path = self._get_topic_path() subscription_name = '{}-{}-{}-worker'.format( queue.PUBSUB_OBJECT_PREFIX, self.n...
def _get_or_create_subscription(self): """In a broadcast queue, workers have a unique subscription ensuring that every worker recieves a copy of every task.""" topic_path = self._get_topic_path() subscription_name = '{}-{}-{}-worker'.format( queue.PUBSUB_OBJECT_PREFIX, self.n...
[ "In", "a", "broadcast", "queue", "workers", "have", "a", "unique", "subscription", "ensuring", "that", "every", "worker", "recieves", "a", "copy", "of", "every", "task", "." ]
GoogleCloudPlatform/psq
python
https://github.com/GoogleCloudPlatform/psq/blob/3c5130731d72b6c32d09a6a5d478f3580ff36d50/psq/broadcast_queue.py#L39-L56
[ "def", "_get_or_create_subscription", "(", "self", ")", ":", "topic_path", "=", "self", ".", "_get_topic_path", "(", ")", "subscription_name", "=", "'{}-{}-{}-worker'", ".", "format", "(", "queue", ".", "PUBSUB_OBJECT_PREFIX", ",", "self", ".", "name", ",", "uui...
3c5130731d72b6c32d09a6a5d478f3580ff36d50
valid
BroadcastQueue.cleanup
Deletes this worker's subscription.
psq/broadcast_queue.py
def cleanup(self): """Deletes this worker's subscription.""" if self.subscription: logger.info("Deleting worker subscription...") self.subscriber_client.delete_subscription(self.subscription)
def cleanup(self): """Deletes this worker's subscription.""" if self.subscription: logger.info("Deleting worker subscription...") self.subscriber_client.delete_subscription(self.subscription)
[ "Deletes", "this", "worker", "s", "subscription", "." ]
GoogleCloudPlatform/psq
python
https://github.com/GoogleCloudPlatform/psq/blob/3c5130731d72b6c32d09a6a5d478f3580ff36d50/psq/broadcast_queue.py#L58-L62
[ "def", "cleanup", "(", "self", ")", ":", "if", "self", ".", "subscription", ":", "logger", ".", "info", "(", "\"Deleting worker subscription...\"", ")", "self", ".", "subscriber_client", ".", "delete_subscription", "(", "self", ".", "subscription", ")" ]
3c5130731d72b6c32d09a6a5d478f3580ff36d50
valid
Queue._get_or_create_subscription
Workers all share the same subscription so that tasks are distributed across all workers.
psq/queue.py
def _get_or_create_subscription(self): """Workers all share the same subscription so that tasks are distributed across all workers.""" topic_path = self._get_topic_path() subscription_name = '{}-{}-shared'.format( PUBSUB_OBJECT_PREFIX, self.name) subscription_path = s...
def _get_or_create_subscription(self): """Workers all share the same subscription so that tasks are distributed across all workers.""" topic_path = self._get_topic_path() subscription_name = '{}-{}-shared'.format( PUBSUB_OBJECT_PREFIX, self.name) subscription_path = s...
[ "Workers", "all", "share", "the", "same", "subscription", "so", "that", "tasks", "are", "distributed", "across", "all", "workers", "." ]
GoogleCloudPlatform/psq
python
https://github.com/GoogleCloudPlatform/psq/blob/3c5130731d72b6c32d09a6a5d478f3580ff36d50/psq/queue.py#L71-L92
[ "def", "_get_or_create_subscription", "(", "self", ")", ":", "topic_path", "=", "self", ".", "_get_topic_path", "(", ")", "subscription_name", "=", "'{}-{}-shared'", ".", "format", "(", "PUBSUB_OBJECT_PREFIX", ",", "self", ".", "name", ")", "subscription_path", "=...
3c5130731d72b6c32d09a6a5d478f3580ff36d50
valid
Queue.enqueue
Enqueues a function for the task queue to execute.
psq/queue.py
def enqueue(self, f, *args, **kwargs): """Enqueues a function for the task queue to execute.""" task = Task(uuid4().hex, f, args, kwargs) self.storage.put_task(task) return self.enqueue_task(task)
def enqueue(self, f, *args, **kwargs): """Enqueues a function for the task queue to execute.""" task = Task(uuid4().hex, f, args, kwargs) self.storage.put_task(task) return self.enqueue_task(task)
[ "Enqueues", "a", "function", "for", "the", "task", "queue", "to", "execute", "." ]
GoogleCloudPlatform/psq
python
https://github.com/GoogleCloudPlatform/psq/blob/3c5130731d72b6c32d09a6a5d478f3580ff36d50/psq/queue.py#L94-L98
[ "def", "enqueue", "(", "self", ",", "f", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "task", "=", "Task", "(", "uuid4", "(", ")", ".", "hex", ",", "f", ",", "args", ",", "kwargs", ")", "self", ".", "storage", ".", "put_task", "(", "t...
3c5130731d72b6c32d09a6a5d478f3580ff36d50
valid
Queue.enqueue_task
Enqueues a task directly. This is used when a task is retried or if a task was manually created. Note that this does not store the task.
psq/queue.py
def enqueue_task(self, task): """Enqueues a task directly. This is used when a task is retried or if a task was manually created. Note that this does not store the task. """ data = dumps(task) if self._async: self.publisher_client.publish(self.topic_path, da...
def enqueue_task(self, task): """Enqueues a task directly. This is used when a task is retried or if a task was manually created. Note that this does not store the task. """ data = dumps(task) if self._async: self.publisher_client.publish(self.topic_path, da...
[ "Enqueues", "a", "task", "directly", ".", "This", "is", "used", "when", "a", "task", "is", "retried", "or", "if", "a", "task", "was", "manually", "created", "." ]
GoogleCloudPlatform/psq
python
https://github.com/GoogleCloudPlatform/psq/blob/3c5130731d72b6c32d09a6a5d478f3580ff36d50/psq/queue.py#L100-L120
[ "def", "enqueue_task", "(", "self", ",", "task", ")", ":", "data", "=", "dumps", "(", "task", ")", "if", "self", ".", "_async", ":", "self", ".", "publisher_client", ".", "publish", "(", "self", ".", "topic_path", ",", "data", "=", "data", ")", "logg...
3c5130731d72b6c32d09a6a5d478f3580ff36d50
valid
unpickle
Unpickles a string, but raises a unified UnpickleError in case anything fails. This is a helper method to not have to deal with the fact that `loads()` potentially raises many types of exceptions (e.g. AttributeError, IndexError, TypeError, KeyError, etc.)
psq/utils.py
def unpickle(pickled_string): """Unpickles a string, but raises a unified UnpickleError in case anything fails. This is a helper method to not have to deal with the fact that `loads()` potentially raises many types of exceptions (e.g. AttributeError, IndexError, TypeError, KeyError, etc.) """ ...
def unpickle(pickled_string): """Unpickles a string, but raises a unified UnpickleError in case anything fails. This is a helper method to not have to deal with the fact that `loads()` potentially raises many types of exceptions (e.g. AttributeError, IndexError, TypeError, KeyError, etc.) """ ...
[ "Unpickles", "a", "string", "but", "raises", "a", "unified", "UnpickleError", "in", "case", "anything", "fails", ".", "This", "is", "a", "helper", "method", "to", "not", "have", "to", "deal", "with", "the", "fact", "that", "loads", "()", "potentially", "ra...
GoogleCloudPlatform/psq
python
https://github.com/GoogleCloudPlatform/psq/blob/3c5130731d72b6c32d09a6a5d478f3580ff36d50/psq/utils.py#L37-L48
[ "def", "unpickle", "(", "pickled_string", ")", ":", "try", ":", "obj", "=", "loads", "(", "pickled_string", ")", "except", "Exception", "as", "e", ":", "raise", "UnpickleError", "(", "'Could not unpickle'", ",", "pickled_string", ",", "e", ")", "return", "ob...
3c5130731d72b6c32d09a6a5d478f3580ff36d50
valid
main
Standalone PSQ worker. The queue argument must be the full importable path to a psq.Queue instance. Example usage: psqworker config.q psqworker --path /opt/app queues.fast
psq/psqworker.py
def main(path, pid, queue): """ Standalone PSQ worker. The queue argument must be the full importable path to a psq.Queue instance. Example usage: psqworker config.q psqworker --path /opt/app queues.fast """ setup_logging() if pid: with open(os.path.expandus...
def main(path, pid, queue): """ Standalone PSQ worker. The queue argument must be the full importable path to a psq.Queue instance. Example usage: psqworker config.q psqworker --path /opt/app queues.fast """ setup_logging() if pid: with open(os.path.expandus...
[ "Standalone", "PSQ", "worker", "." ]
GoogleCloudPlatform/psq
python
https://github.com/GoogleCloudPlatform/psq/blob/3c5130731d72b6c32d09a6a5d478f3580ff36d50/psq/psqworker.py#L72-L103
[ "def", "main", "(", "path", ",", "pid", ",", "queue", ")", ":", "setup_logging", "(", ")", "if", "pid", ":", "with", "open", "(", "os", ".", "path", ".", "expanduser", "(", "pid", ")", ",", "\"w\"", ")", "as", "f", ":", "f", ".", "write", "(", ...
3c5130731d72b6c32d09a6a5d478f3580ff36d50
valid
TaskResult.result
Gets the result of the task. Arguments: timeout: Maximum seconds to wait for a result before raising a TimeoutError. If set to None, this will wait forever. If the queue doesn't store results and timeout is None, this call will never return.
psq/task.py
def result(self, timeout=None): """Gets the result of the task. Arguments: timeout: Maximum seconds to wait for a result before raising a TimeoutError. If set to None, this will wait forever. If the queue doesn't store results and timeout is None, this call w...
def result(self, timeout=None): """Gets the result of the task. Arguments: timeout: Maximum seconds to wait for a result before raising a TimeoutError. If set to None, this will wait forever. If the queue doesn't store results and timeout is None, this call w...
[ "Gets", "the", "result", "of", "the", "task", "." ]
GoogleCloudPlatform/psq
python
https://github.com/GoogleCloudPlatform/psq/blob/3c5130731d72b6c32d09a6a5d478f3580ff36d50/psq/task.py#L148-L171
[ "def", "result", "(", "self", ",", "timeout", "=", "None", ")", ":", "start", "=", "time", ".", "time", "(", ")", "while", "True", ":", "task", "=", "self", ".", "get_task", "(", ")", "if", "not", "task", "or", "task", ".", "status", "not", "in",...
3c5130731d72b6c32d09a6a5d478f3580ff36d50
valid
service_start
Launch a Process, return his pid
server/db_generator.py
def service_start(service=None, param=None): """ Launch a Process, return his pid """ if service is not None: to_run = ["python", service] if param is not None: to_run += param return subprocess.Popen(to_run) return False
def service_start(service=None, param=None): """ Launch a Process, return his pid """ if service is not None: to_run = ["python", service] if param is not None: to_run += param return subprocess.Popen(to_run) return False
[ "Launch", "a", "Process", "return", "his", "pid" ]
CIRCL/IP-ASN-history
python
https://github.com/CIRCL/IP-ASN-history/blob/2e02ced01a08531a007d9cd71547c8248570de1b/server/db_generator.py#L36-L45
[ "def", "service_start", "(", "service", "=", "None", ",", "param", "=", "None", ")", ":", "if", "service", "is", "not", "None", ":", "to_run", "=", "[", "\"python\"", ",", "service", "]", "if", "param", "is", "not", "None", ":", "to_run", "+=", "para...
2e02ced01a08531a007d9cd71547c8248570de1b
valid
update_running_pids
Update the list of the running process and return the list
server/db_generator.py
def update_running_pids(old_procs): """ Update the list of the running process and return the list """ new_procs = [] for proc in old_procs: if proc.poll() is None and check_pid(proc.pid): publisher.debug(str(proc.pid) + ' is alive') new_procs.append(proc) ...
def update_running_pids(old_procs): """ Update the list of the running process and return the list """ new_procs = [] for proc in old_procs: if proc.poll() is None and check_pid(proc.pid): publisher.debug(str(proc.pid) + ' is alive') new_procs.append(proc) ...
[ "Update", "the", "list", "of", "the", "running", "process", "and", "return", "the", "list" ]
CIRCL/IP-ASN-history
python
https://github.com/CIRCL/IP-ASN-history/blob/2e02ced01a08531a007d9cd71547c8248570de1b/server/db_generator.py#L48-L64
[ "def", "update_running_pids", "(", "old_procs", ")", ":", "new_procs", "=", "[", "]", "for", "proc", "in", "old_procs", ":", "if", "proc", ".", "poll", "(", ")", "is", "None", "and", "check_pid", "(", "proc", ".", "pid", ")", ":", "publisher", ".", "...
2e02ced01a08531a007d9cd71547c8248570de1b
valid
run_splitted_processing
Run processes which push the routing dump of the RIPE in a redis database. The dump has been splitted in multiple files and each process run on one of this files.
server/db_generator.py
def run_splitted_processing(max_simultaneous_processes, process_name, filenames): """ Run processes which push the routing dump of the RIPE in a redis database. The dump has been splitted in multiple files and each process run on one of this files. """...
def run_splitted_processing(max_simultaneous_processes, process_name, filenames): """ Run processes which push the routing dump of the RIPE in a redis database. The dump has been splitted in multiple files and each process run on one of this files. """...
[ "Run", "processes", "which", "push", "the", "routing", "dump", "of", "the", "RIPE", "in", "a", "redis", "database", ".", "The", "dump", "has", "been", "splitted", "in", "multiple", "files", "and", "each", "process", "run", "on", "one", "of", "this", "fil...
CIRCL/IP-ASN-history
python
https://github.com/CIRCL/IP-ASN-history/blob/2e02ced01a08531a007d9cd71547c8248570de1b/server/db_generator.py#L79-L100
[ "def", "run_splitted_processing", "(", "max_simultaneous_processes", ",", "process_name", ",", "filenames", ")", ":", "pids", "=", "[", "]", "while", "len", "(", "filenames", ")", ">", "0", ":", "while", "len", "(", "filenames", ")", ">", "0", "and", "len"...
2e02ced01a08531a007d9cd71547c8248570de1b
valid
fsplit
Split the file and return the list of filenames.
server/file_splitter.py
def fsplit(file_to_split): """ Split the file and return the list of filenames. """ dirname = file_to_split + '_splitted' if not os.path.exists(dirname): os.mkdir(dirname) part_file_size = os.path.getsize(file_to_split) / number_of_files + 1 splitted_files = [] with open(file...
def fsplit(file_to_split): """ Split the file and return the list of filenames. """ dirname = file_to_split + '_splitted' if not os.path.exists(dirname): os.mkdir(dirname) part_file_size = os.path.getsize(file_to_split) / number_of_files + 1 splitted_files = [] with open(file...
[ "Split", "the", "file", "and", "return", "the", "list", "of", "filenames", "." ]
CIRCL/IP-ASN-history
python
https://github.com/CIRCL/IP-ASN-history/blob/2e02ced01a08531a007d9cd71547c8248570de1b/server/file_splitter.py#L23-L64
[ "def", "fsplit", "(", "file_to_split", ")", ":", "dirname", "=", "file_to_split", "+", "'_splitted'", "if", "not", "os", ".", "path", ".", "exists", "(", "dirname", ")", ":", "os", ".", "mkdir", "(", "dirname", ")", "part_file_size", "=", "os", ".", "p...
2e02ced01a08531a007d9cd71547c8248570de1b
valid
__entry_point
Function called when an query is made on /json. Expects a JSON object with at least a 'method' entry.
apiweb/webservice.py
def __entry_point(): """ Function called when an query is made on /json. Expects a JSON object with at least a 'method' entry. """ ip = request.remote_addr ua = request.headers.get('User-Agent', 'Empty User-Agent') method = request.json.get('method') if method is None: __...
def __entry_point(): """ Function called when an query is made on /json. Expects a JSON object with at least a 'method' entry. """ ip = request.remote_addr ua = request.headers.get('User-Agent', 'Empty User-Agent') method = request.json.get('method') if method is None: __...
[ "Function", "called", "when", "an", "query", "is", "made", "on", "/", "json", ".", "Expects", "a", "JSON", "object", "with", "at", "least", "a", "method", "entry", "." ]
CIRCL/IP-ASN-history
python
https://github.com/CIRCL/IP-ASN-history/blob/2e02ced01a08531a007d9cd71547c8248570de1b/apiweb/webservice.py#L75-L105
[ "def", "__entry_point", "(", ")", ":", "ip", "=", "request", ".", "remote_addr", "ua", "=", "request", ".", "headers", ".", "get", "(", "'User-Agent'", ",", "'Empty User-Agent'", ")", "method", "=", "request", ".", "json", ".", "get", "(", "'method'", ")...
2e02ced01a08531a007d9cd71547c8248570de1b
valid
IPASN.asn
Give an IP, maybe a date, get the ASN. This is the fastest command. :param ip: IP address to search for :param announce_date: Date of the announcement :rtype: String, ASN.
client/ipasn_redis/api.py
def asn(self, ip, announce_date=None): """ Give an IP, maybe a date, get the ASN. This is the fastest command. :param ip: IP address to search for :param announce_date: Date of the announcement :rtype: String, ASN. """ assignations, ...
def asn(self, ip, announce_date=None): """ Give an IP, maybe a date, get the ASN. This is the fastest command. :param ip: IP address to search for :param announce_date: Date of the announcement :rtype: String, ASN. """ assignations, ...
[ "Give", "an", "IP", "maybe", "a", "date", "get", "the", "ASN", ".", "This", "is", "the", "fastest", "command", "." ]
CIRCL/IP-ASN-history
python
https://github.com/CIRCL/IP-ASN-history/blob/2e02ced01a08531a007d9cd71547c8248570de1b/client/ipasn_redis/api.py#L77-L89
[ "def", "asn", "(", "self", ",", "ip", ",", "announce_date", "=", "None", ")", ":", "assignations", ",", "announce_date", ",", "_", "=", "self", ".", "run", "(", "ip", ",", "announce_date", ")", "return", "next", "(", "(", "assign", "for", "assign", "...
2e02ced01a08531a007d9cd71547c8248570de1b
valid
IPASN.date_asn_block
Get the ASN and the IP Block announcing the IP at a specific date. :param ip: IP address to search for :param announce_date: Date of the announcement :rtype: tuple .. code-block:: python (announce_date, asn, block) .. note:: ...
client/ipasn_redis/api.py
def date_asn_block(self, ip, announce_date=None): """ Get the ASN and the IP Block announcing the IP at a specific date. :param ip: IP address to search for :param announce_date: Date of the announcement :rtype: tuple .. code-block:: python ...
def date_asn_block(self, ip, announce_date=None): """ Get the ASN and the IP Block announcing the IP at a specific date. :param ip: IP address to search for :param announce_date: Date of the announcement :rtype: tuple .. code-block:: python ...
[ "Get", "the", "ASN", "and", "the", "IP", "Block", "announcing", "the", "IP", "at", "a", "specific", "date", "." ]
CIRCL/IP-ASN-history
python
https://github.com/CIRCL/IP-ASN-history/blob/2e02ced01a08531a007d9cd71547c8248570de1b/client/ipasn_redis/api.py#L91-L117
[ "def", "date_asn_block", "(", "self", ",", "ip", ",", "announce_date", "=", "None", ")", ":", "assignations", ",", "announce_date", ",", "keys", "=", "self", ".", "run", "(", "ip", ",", "announce_date", ")", "pos", "=", "next", "(", "(", "i", "for", ...
2e02ced01a08531a007d9cd71547c8248570de1b
valid
IPASN.history
Get the full history of an IP. It takes time. :param ip: IP address to search for :param days_limit: Max amount of days to query. (None means no limit) :rtype: list. For each day in the database: day, asn, block
client/ipasn_redis/api.py
def history(self, ip, days_limit=None): """ Get the full history of an IP. It takes time. :param ip: IP address to search for :param days_limit: Max amount of days to query. (None means no limit) :rtype: list. For each day in the database: day, asn, block ...
def history(self, ip, days_limit=None): """ Get the full history of an IP. It takes time. :param ip: IP address to search for :param days_limit: Max amount of days to query. (None means no limit) :rtype: list. For each day in the database: day, asn, block ...
[ "Get", "the", "full", "history", "of", "an", "IP", ".", "It", "takes", "time", "." ]
CIRCL/IP-ASN-history
python
https://github.com/CIRCL/IP-ASN-history/blob/2e02ced01a08531a007d9cd71547c8248570de1b/client/ipasn_redis/api.py#L119-L131
[ "def", "history", "(", "self", ",", "ip", ",", "days_limit", "=", "None", ")", ":", "all_dates", "=", "sorted", "(", "self", ".", "routing_db", ".", "smembers", "(", "'imported_dates'", ")", ",", "reverse", "=", "True", ")", "if", "days_limit", "is", "...
2e02ced01a08531a007d9cd71547c8248570de1b
valid
IPASN.aggregate_history
Get the full history of an IP, aggregate the result instead of returning one line per day. :param ip: IP address to search for :param days_limit: Max amount of days to query. (None means no limit) :rtype: list. For each change: FirstDay, LastDay, ASN, Block
client/ipasn_redis/api.py
def aggregate_history(self, ip, days_limit=None): """ Get the full history of an IP, aggregate the result instead of returning one line per day. :param ip: IP address to search for :param days_limit: Max amount of days to query. (None means no limit) ...
def aggregate_history(self, ip, days_limit=None): """ Get the full history of an IP, aggregate the result instead of returning one line per day. :param ip: IP address to search for :param days_limit: Max amount of days to query. (None means no limit) ...
[ "Get", "the", "full", "history", "of", "an", "IP", "aggregate", "the", "result", "instead", "of", "returning", "one", "line", "per", "day", "." ]
CIRCL/IP-ASN-history
python
https://github.com/CIRCL/IP-ASN-history/blob/2e02ced01a08531a007d9cd71547c8248570de1b/client/ipasn_redis/api.py#L133-L165
[ "def", "aggregate_history", "(", "self", ",", "ip", ",", "days_limit", "=", "None", ")", ":", "first_date", "=", "None", "last_date", "=", "None", "prec_asn", "=", "None", "prec_block", "=", "None", "for", "entry", "in", "self", ".", "history", "(", "ip"...
2e02ced01a08531a007d9cd71547c8248570de1b
valid
downloadURL
Inconditianilly download the URL in a temporary directory. When finished, the file is moved in the real directory. Like this an other process will not attempt to extract an inclomplete file.
server/fetch_historical_bviews.py
def downloadURL(url, filename): """ Inconditianilly download the URL in a temporary directory. When finished, the file is moved in the real directory. Like this an other process will not attempt to extract an inclomplete file. """ path_temp_bviewfile = os.path.join(c.raw_data, c.bvie...
def downloadURL(url, filename): """ Inconditianilly download the URL in a temporary directory. When finished, the file is moved in the real directory. Like this an other process will not attempt to extract an inclomplete file. """ path_temp_bviewfile = os.path.join(c.raw_data, c.bvie...
[ "Inconditianilly", "download", "the", "URL", "in", "a", "temporary", "directory", ".", "When", "finished", "the", "file", "is", "moved", "in", "the", "real", "directory", ".", "Like", "this", "an", "other", "process", "will", "not", "attempt", "to", "extract...
CIRCL/IP-ASN-history
python
https://github.com/CIRCL/IP-ASN-history/blob/2e02ced01a08531a007d9cd71547c8248570de1b/server/fetch_historical_bviews.py#L77-L99
[ "def", "downloadURL", "(", "url", ",", "filename", ")", ":", "path_temp_bviewfile", "=", "os", ".", "path", ".", "join", "(", "c", ".", "raw_data", ",", "c", ".", "bview_dir", ",", "'tmp'", ",", "filename", ")", "path_bviewfile", "=", "os", ".", "path"...
2e02ced01a08531a007d9cd71547c8248570de1b
valid
already_downloaded
Verify that the file has not already been downloaded.
server/fetch_historical_bviews.py
def already_downloaded(filename): """ Verify that the file has not already been downloaded. """ cur_file = os.path.join(c.bview_dir, filename) old_file = os.path.join(c.bview_dir, 'old', filename) if not os.path.exists(cur_file) and not os.path.exists(old_file): return False retu...
def already_downloaded(filename): """ Verify that the file has not already been downloaded. """ cur_file = os.path.join(c.bview_dir, filename) old_file = os.path.join(c.bview_dir, 'old', filename) if not os.path.exists(cur_file) and not os.path.exists(old_file): return False retu...
[ "Verify", "that", "the", "file", "has", "not", "already", "been", "downloaded", "." ]
CIRCL/IP-ASN-history
python
https://github.com/CIRCL/IP-ASN-history/blob/2e02ced01a08531a007d9cd71547c8248570de1b/server/fetch_historical_bviews.py#L102-L110
[ "def", "already_downloaded", "(", "filename", ")", ":", "cur_file", "=", "os", ".", "path", ".", "join", "(", "c", ".", "bview_dir", ",", "filename", ")", "old_file", "=", "os", ".", "path", ".", "join", "(", "c", ".", "bview_dir", ",", "'old'", ",",...
2e02ced01a08531a007d9cd71547c8248570de1b
valid
to_download
Build interval of urls to download. We always get the first file of the next day. Ex: 2013-01-01 => 2013-01-02.0000
server/fetch_historical_bviews.py
def to_download(): """ Build interval of urls to download. We always get the first file of the next day. Ex: 2013-01-01 => 2013-01-02.0000 """ first_day = parse(interval_first) last_day = parse(interval_last) format_change = parse('2010-06-14') one_day = datetime.timedelt...
def to_download(): """ Build interval of urls to download. We always get the first file of the next day. Ex: 2013-01-01 => 2013-01-02.0000 """ first_day = parse(interval_first) last_day = parse(interval_last) format_change = parse('2010-06-14') one_day = datetime.timedelt...
[ "Build", "interval", "of", "urls", "to", "download", ".", "We", "always", "get", "the", "first", "file", "of", "the", "next", "day", ".", "Ex", ":", "2013", "-", "01", "-", "01", "=", ">", "2013", "-", "01", "-", "02", ".", "0000" ]
CIRCL/IP-ASN-history
python
https://github.com/CIRCL/IP-ASN-history/blob/2e02ced01a08531a007d9cd71547c8248570de1b/server/fetch_historical_bviews.py#L113-L136
[ "def", "to_download", "(", ")", ":", "first_day", "=", "parse", "(", "interval_first", ")", "last_day", "=", "parse", "(", "interval_last", ")", "format_change", "=", "parse", "(", "'2010-06-14'", ")", "one_day", "=", "datetime", ".", "timedelta", "(", "1", ...
2e02ced01a08531a007d9cd71547c8248570de1b
valid
strToBool
Helper function to turn a string representation of "true" into boolean True.
bootstrap_pagination/templatetags/bootstrap_pagination.py
def strToBool(val): """ Helper function to turn a string representation of "true" into boolean True. """ if isinstance(val, str): val = val.lower() return val in ['true', 'on', 'yes', True]
def strToBool(val): """ Helper function to turn a string representation of "true" into boolean True. """ if isinstance(val, str): val = val.lower() return val in ['true', 'on', 'yes', True]
[ "Helper", "function", "to", "turn", "a", "string", "representation", "of", "true", "into", "boolean", "True", "." ]
jmcclell/django-bootstrap-pagination
python
https://github.com/jmcclell/django-bootstrap-pagination/blob/3a8187fb6e9b7c2ea4563698e1c3d117204e5049/bootstrap_pagination/templatetags/bootstrap_pagination.py#L46-L54
[ "def", "strToBool", "(", "val", ")", ":", "if", "isinstance", "(", "val", ",", "str", ")", ":", "val", "=", "val", ".", "lower", "(", ")", "return", "val", "in", "[", "'true'", ",", "'on'", ",", "'yes'", ",", "True", "]" ]
3a8187fb6e9b7c2ea4563698e1c3d117204e5049
valid
get_page_url
Helper function to return a valid URL string given the template tag parameters
bootstrap_pagination/templatetags/bootstrap_pagination.py
def get_page_url(page_num, current_app, url_view_name, url_extra_args, url_extra_kwargs, url_param_name, url_get_params, url_anchor): """ Helper function to return a valid URL string given the template tag parameters """ if url_view_name is not None: # Add page param to the kwargs list. Override...
def get_page_url(page_num, current_app, url_view_name, url_extra_args, url_extra_kwargs, url_param_name, url_get_params, url_anchor): """ Helper function to return a valid URL string given the template tag parameters """ if url_view_name is not None: # Add page param to the kwargs list. Override...
[ "Helper", "function", "to", "return", "a", "valid", "URL", "string", "given", "the", "template", "tag", "parameters" ]
jmcclell/django-bootstrap-pagination
python
https://github.com/jmcclell/django-bootstrap-pagination/blob/3a8187fb6e9b7c2ea4563698e1c3d117204e5049/bootstrap_pagination/templatetags/bootstrap_pagination.py#L57-L99
[ "def", "get_page_url", "(", "page_num", ",", "current_app", ",", "url_view_name", ",", "url_extra_args", ",", "url_extra_kwargs", ",", "url_param_name", ",", "url_get_params", ",", "url_anchor", ")", ":", "if", "url_view_name", "is", "not", "None", ":", "# Add pag...
3a8187fb6e9b7c2ea4563698e1c3d117204e5049
valid
bootstrap_paginate
Renders a Page object as a Twitter Bootstrap styled pagination bar. Compatible with Bootstrap 3.x and 4.x only. Example:: {% bootstrap_paginate page_obj range=10 %} Named Parameters:: range - The size of the pagination bar (ie, if set to 10 then, at most, 10 page numbers...
bootstrap_pagination/templatetags/bootstrap_pagination.py
def bootstrap_paginate(parser, token): """ Renders a Page object as a Twitter Bootstrap styled pagination bar. Compatible with Bootstrap 3.x and 4.x only. Example:: {% bootstrap_paginate page_obj range=10 %} Named Parameters:: range - The size of the pagination bar (ie, if set t...
def bootstrap_paginate(parser, token): """ Renders a Page object as a Twitter Bootstrap styled pagination bar. Compatible with Bootstrap 3.x and 4.x only. Example:: {% bootstrap_paginate page_obj range=10 %} Named Parameters:: range - The size of the pagination bar (ie, if set t...
[ "Renders", "a", "Page", "object", "as", "a", "Twitter", "Bootstrap", "styled", "pagination", "bar", ".", "Compatible", "with", "Bootstrap", "3", ".", "x", "and", "4", ".", "x", "only", "." ]
jmcclell/django-bootstrap-pagination
python
https://github.com/jmcclell/django-bootstrap-pagination/blob/3a8187fb6e9b7c2ea4563698e1c3d117204e5049/bootstrap_pagination/templatetags/bootstrap_pagination.py#L286-L377
[ "def", "bootstrap_paginate", "(", "parser", ",", "token", ")", ":", "bits", "=", "token", ".", "split_contents", "(", ")", "if", "len", "(", "bits", ")", "<", "2", ":", "raise", "TemplateSyntaxError", "(", "\"'%s' takes at least one argument\"", "\" (Page object...
3a8187fb6e9b7c2ea4563698e1c3d117204e5049
valid
configure_devel_jobs
Configure all Jenkins devel jobs. L{configure_release_job} will be invoked for source repository and target which matches the build file criteria.
ros_buildfarm/devel_job.py
def configure_devel_jobs( config_url, rosdistro_name, source_build_name, groovy_script=None, dry_run=False, whitelist_repository_names=None): """ Configure all Jenkins devel jobs. L{configure_release_job} will be invoked for source repository and target which matches the build file crit...
def configure_devel_jobs( config_url, rosdistro_name, source_build_name, groovy_script=None, dry_run=False, whitelist_repository_names=None): """ Configure all Jenkins devel jobs. L{configure_release_job} will be invoked for source repository and target which matches the build file crit...
[ "Configure", "all", "Jenkins", "devel", "jobs", "." ]
ros-infrastructure/ros_buildfarm
python
https://github.com/ros-infrastructure/ros_buildfarm/blob/c63ad85b21470f3262086fcd987528a0efc0cf6d/ros_buildfarm/devel_job.py#L40-L212
[ "def", "configure_devel_jobs", "(", "config_url", ",", "rosdistro_name", ",", "source_build_name", ",", "groovy_script", "=", "None", ",", "dry_run", "=", "False", ",", "whitelist_repository_names", "=", "None", ")", ":", "config", "=", "get_config_index", "(", "c...
c63ad85b21470f3262086fcd987528a0efc0cf6d
valid
configure_devel_job
Configure a single Jenkins devel job. This includes the following steps: - clone the source repository to use - clone the ros_buildfarm repository - write the distribution repository keys into files - invoke the release/run_devel_job.py script
ros_buildfarm/devel_job.py
def configure_devel_job( config_url, rosdistro_name, source_build_name, repo_name, os_name, os_code_name, arch, pull_request=False, config=None, build_file=None, index=None, dist_file=None, dist_cache=None, jenkins=None, views=None, is_disabled=False, groo...
def configure_devel_job( config_url, rosdistro_name, source_build_name, repo_name, os_name, os_code_name, arch, pull_request=False, config=None, build_file=None, index=None, dist_file=None, dist_cache=None, jenkins=None, views=None, is_disabled=False, groo...
[ "Configure", "a", "single", "Jenkins", "devel", "job", "." ]
ros-infrastructure/ros_buildfarm
python
https://github.com/ros-infrastructure/ros_buildfarm/blob/c63ad85b21470f3262086fcd987528a0efc0cf6d/ros_buildfarm/devel_job.py#L215-L311
[ "def", "configure_devel_job", "(", "config_url", ",", "rosdistro_name", ",", "source_build_name", ",", "repo_name", ",", "os_name", ",", "os_code_name", ",", "arch", ",", "pull_request", "=", "False", ",", "config", "=", "None", ",", "build_file", "=", "None", ...
c63ad85b21470f3262086fcd987528a0efc0cf6d
valid
configure_release_jobs
Configure all Jenkins release jobs. L{configure_release_job} will be invoked for every released package and target which matches the build file criteria. Additionally a job to import Debian packages into the Debian repository is created.
ros_buildfarm/release_job.py
def configure_release_jobs( config_url, rosdistro_name, release_build_name, groovy_script=None, dry_run=False, whitelist_package_names=None): """ Configure all Jenkins release jobs. L{configure_release_job} will be invoked for every released package and target which matches the build fi...
def configure_release_jobs( config_url, rosdistro_name, release_build_name, groovy_script=None, dry_run=False, whitelist_package_names=None): """ Configure all Jenkins release jobs. L{configure_release_job} will be invoked for every released package and target which matches the build fi...
[ "Configure", "all", "Jenkins", "release", "jobs", "." ]
ros-infrastructure/ros_buildfarm
python
https://github.com/ros-infrastructure/ros_buildfarm/blob/c63ad85b21470f3262086fcd987528a0efc0cf6d/ros_buildfarm/release_job.py#L44-L333
[ "def", "configure_release_jobs", "(", "config_url", ",", "rosdistro_name", ",", "release_build_name", ",", "groovy_script", "=", "None", ",", "dry_run", "=", "False", ",", "whitelist_package_names", "=", "None", ")", ":", "config", "=", "get_config_index", "(", "c...
c63ad85b21470f3262086fcd987528a0efc0cf6d
valid
configure_release_job
Configure a Jenkins release job. The following jobs are created for each package: - M source jobs, one for each OS node name - M * N binary jobs, one for each combination of OS code name and arch
ros_buildfarm/release_job.py
def configure_release_job( config_url, rosdistro_name, release_build_name, pkg_name, os_name, os_code_name, config=None, build_file=None, index=None, dist_file=None, dist_cache=None, jenkins=None, views=None, generate_import_package_job=True, generate_sync_package...
def configure_release_job( config_url, rosdistro_name, release_build_name, pkg_name, os_name, os_code_name, config=None, build_file=None, index=None, dist_file=None, dist_cache=None, jenkins=None, views=None, generate_import_package_job=True, generate_sync_package...
[ "Configure", "a", "Jenkins", "release", "job", "." ]
ros-infrastructure/ros_buildfarm
python
https://github.com/ros-infrastructure/ros_buildfarm/blob/c63ad85b21470f3262086fcd987528a0efc0cf6d/ros_buildfarm/release_job.py#L347-L518
[ "def", "configure_release_job", "(", "config_url", ",", "rosdistro_name", ",", "release_build_name", ",", "pkg_name", ",", "os_name", ",", "os_code_name", ",", "config", "=", "None", ",", "build_file", "=", "None", ",", "index", "=", "None", ",", "dist_file", ...
c63ad85b21470f3262086fcd987528a0efc0cf6d
valid
configure_doc_jobs
Configure all Jenkins doc jobs. L{configure_doc_job} will be invoked for doc repository and target which matches the build file criteria.
ros_buildfarm/doc_job.py
def configure_doc_jobs( config_url, rosdistro_name, doc_build_name, groovy_script=None, dry_run=False, whitelist_repository_names=None): """ Configure all Jenkins doc jobs. L{configure_doc_job} will be invoked for doc repository and target which matches the build file criteria. """ ...
def configure_doc_jobs( config_url, rosdistro_name, doc_build_name, groovy_script=None, dry_run=False, whitelist_repository_names=None): """ Configure all Jenkins doc jobs. L{configure_doc_job} will be invoked for doc repository and target which matches the build file criteria. """ ...
[ "Configure", "all", "Jenkins", "doc", "jobs", "." ]
ros-infrastructure/ros_buildfarm
python
https://github.com/ros-infrastructure/ros_buildfarm/blob/c63ad85b21470f3262086fcd987528a0efc0cf6d/ros_buildfarm/doc_job.py#L41-L156
[ "def", "configure_doc_jobs", "(", "config_url", ",", "rosdistro_name", ",", "doc_build_name", ",", "groovy_script", "=", "None", ",", "dry_run", "=", "False", ",", "whitelist_repository_names", "=", "None", ")", ":", "config", "=", "get_config_index", "(", "config...
c63ad85b21470f3262086fcd987528a0efc0cf6d
valid
configure_doc_job
Configure a single Jenkins doc job. This includes the following steps: - clone the doc repository to use - clone the ros_buildfarm repository - write the distribution repository keys into files - invoke the run_doc_job.py script
ros_buildfarm/doc_job.py
def configure_doc_job( config_url, rosdistro_name, doc_build_name, repo_name, os_name, os_code_name, arch, config=None, build_file=None, index=None, dist_file=None, dist_cache=None, jenkins=None, views=None, is_disabled=False, groovy_script=None, doc_repos...
def configure_doc_job( config_url, rosdistro_name, doc_build_name, repo_name, os_name, os_code_name, arch, config=None, build_file=None, index=None, dist_file=None, dist_cache=None, jenkins=None, views=None, is_disabled=False, groovy_script=None, doc_repos...
[ "Configure", "a", "single", "Jenkins", "doc", "job", "." ]
ros-infrastructure/ros_buildfarm
python
https://github.com/ros-infrastructure/ros_buildfarm/blob/c63ad85b21470f3262086fcd987528a0efc0cf6d/ros_buildfarm/doc_job.py#L159-L249
[ "def", "configure_doc_job", "(", "config_url", ",", "rosdistro_name", ",", "doc_build_name", ",", "repo_name", ",", "os_name", ",", "os_code_name", ",", "arch", ",", "config", "=", "None", ",", "build_file", "=", "None", ",", "index", "=", "None", ",", "dist...
c63ad85b21470f3262086fcd987528a0efc0cf6d
valid
get_affected_by_sync
For each package and target check if it is affected by a sync. This is the case when the package version in the testing repo is different from the version in the main repo. :return: a dict indexed by package names containing dicts indexed by targets containing a boolean flag
ros_buildfarm/status_page.py
def get_affected_by_sync( package_descriptors, targets, testing_repo_data, main_repo_data): """ For each package and target check if it is affected by a sync. This is the case when the package version in the testing repo is different from the version in the main repo. :return: a di...
def get_affected_by_sync( package_descriptors, targets, testing_repo_data, main_repo_data): """ For each package and target check if it is affected by a sync. This is the case when the package version in the testing repo is different from the version in the main repo. :return: a di...
[ "For", "each", "package", "and", "target", "check", "if", "it", "is", "affected", "by", "a", "sync", "." ]
ros-infrastructure/ros_buildfarm
python
https://github.com/ros-infrastructure/ros_buildfarm/blob/c63ad85b21470f3262086fcd987528a0efc0cf6d/ros_buildfarm/status_page.py#L300-L326
[ "def", "get_affected_by_sync", "(", "package_descriptors", ",", "targets", ",", "testing_repo_data", ",", "main_repo_data", ")", ":", "affected_by_sync", "=", "{", "}", "for", "package_descriptor", "in", "package_descriptors", ".", "values", "(", ")", ":", "pkg_name...
c63ad85b21470f3262086fcd987528a0efc0cf6d
valid
get_regressions
For each package and target check if it is a regression. This is the case if the main repo contains a package version which is higher then in any of the other repos or if any of the other repos does not contain that package at all. :return: a dict indexed by package names containing dicts indexe...
ros_buildfarm/status_page.py
def get_regressions( package_descriptors, targets, building_repo_data, testing_repo_data, main_repo_data): """ For each package and target check if it is a regression. This is the case if the main repo contains a package version which is higher then in any of the other repos or if any o...
def get_regressions( package_descriptors, targets, building_repo_data, testing_repo_data, main_repo_data): """ For each package and target check if it is a regression. This is the case if the main repo contains a package version which is higher then in any of the other repos or if any o...
[ "For", "each", "package", "and", "target", "check", "if", "it", "is", "a", "regression", "." ]
ros-infrastructure/ros_buildfarm
python
https://github.com/ros-infrastructure/ros_buildfarm/blob/c63ad85b21470f3262086fcd987528a0efc0cf6d/ros_buildfarm/status_page.py#L329-L359
[ "def", "get_regressions", "(", "package_descriptors", ",", "targets", ",", "building_repo_data", ",", "testing_repo_data", ",", "main_repo_data", ")", ":", "regressions", "=", "{", "}", "for", "package_descriptor", "in", "package_descriptors", ".", "values", "(", ")...
c63ad85b21470f3262086fcd987528a0efc0cf6d
valid
get_version_status
For each package and target check if it is affected by a sync. This is the case when the package version in the testing repo is different from the version in the main repo. :return: a dict indexed by package names containing dicts indexed by targets containing a list of status strings (one for...
ros_buildfarm/status_page.py
def get_version_status( package_descriptors, targets, repos_data, strip_version=False, strip_os_code_name=False): """ For each package and target check if it is affected by a sync. This is the case when the package version in the testing repo is different from the version in the main re...
def get_version_status( package_descriptors, targets, repos_data, strip_version=False, strip_os_code_name=False): """ For each package and target check if it is affected by a sync. This is the case when the package version in the testing repo is different from the version in the main re...
[ "For", "each", "package", "and", "target", "check", "if", "it", "is", "affected", "by", "a", "sync", "." ]
ros-infrastructure/ros_buildfarm
python
https://github.com/ros-infrastructure/ros_buildfarm/blob/c63ad85b21470f3262086fcd987528a0efc0cf6d/ros_buildfarm/status_page.py#L362-L410
[ "def", "get_version_status", "(", "package_descriptors", ",", "targets", ",", "repos_data", ",", "strip_version", "=", "False", ",", "strip_os_code_name", "=", "False", ")", ":", "status", "=", "{", "}", "for", "package_descriptor", "in", "package_descriptors", "....
c63ad85b21470f3262086fcd987528a0efc0cf6d
valid
_strip_version_suffix
Remove trailing junk from the version number. >>> strip_version_suffix('') '' >>> strip_version_suffix('None') 'None' >>> strip_version_suffix('1.2.3-4trusty-20140131-1359-+0000') '1.2.3-4' >>> strip_version_suffix('1.2.3-foo') '1.2.3'
ros_buildfarm/status_page.py
def _strip_version_suffix(version): """ Remove trailing junk from the version number. >>> strip_version_suffix('') '' >>> strip_version_suffix('None') 'None' >>> strip_version_suffix('1.2.3-4trusty-20140131-1359-+0000') '1.2.3-4' >>> strip_version_suffix('1.2.3-foo') '1.2.3' ...
def _strip_version_suffix(version): """ Remove trailing junk from the version number. >>> strip_version_suffix('') '' >>> strip_version_suffix('None') 'None' >>> strip_version_suffix('1.2.3-4trusty-20140131-1359-+0000') '1.2.3-4' >>> strip_version_suffix('1.2.3-foo') '1.2.3' ...
[ "Remove", "trailing", "junk", "from", "the", "version", "number", "." ]
ros-infrastructure/ros_buildfarm
python
https://github.com/ros-infrastructure/ros_buildfarm/blob/c63ad85b21470f3262086fcd987528a0efc0cf6d/ros_buildfarm/status_page.py#L416-L433
[ "def", "_strip_version_suffix", "(", "version", ")", ":", "global", "version_regex", "if", "not", "version", ":", "return", "version", "match", "=", "version_regex", ".", "search", "(", "version", ")", "return", "match", ".", "group", "(", "0", ")", "if", ...
c63ad85b21470f3262086fcd987528a0efc0cf6d
valid
get_homogeneous
For each package check if the version in one repo is equal for all targets. The version could be different in different repos though. :return: a dict indexed by package names containing a boolean flag
ros_buildfarm/status_page.py
def get_homogeneous(package_descriptors, targets, repos_data): """ For each package check if the version in one repo is equal for all targets. The version could be different in different repos though. :return: a dict indexed by package names containing a boolean flag """ homogeneous = {} f...
def get_homogeneous(package_descriptors, targets, repos_data): """ For each package check if the version in one repo is equal for all targets. The version could be different in different repos though. :return: a dict indexed by package names containing a boolean flag """ homogeneous = {} f...
[ "For", "each", "package", "check", "if", "the", "version", "in", "one", "repo", "is", "equal", "for", "all", "targets", "." ]
ros-infrastructure/ros_buildfarm
python
https://github.com/ros-infrastructure/ros_buildfarm/blob/c63ad85b21470f3262086fcd987528a0efc0cf6d/ros_buildfarm/status_page.py#L444-L465
[ "def", "get_homogeneous", "(", "package_descriptors", ",", "targets", ",", "repos_data", ")", ":", "homogeneous", "=", "{", "}", "for", "package_descriptor", "in", "package_descriptors", ".", "values", "(", ")", ":", "pkg_name", "=", "package_descriptor", ".", "...
c63ad85b21470f3262086fcd987528a0efc0cf6d
valid
get_package_counts
Get the number of packages per target and repository. :return: a dict indexed by targets containing a list of integer values (one for each repo)
ros_buildfarm/status_page.py
def get_package_counts(package_descriptors, targets, repos_data): """ Get the number of packages per target and repository. :return: a dict indexed by targets containing a list of integer values (one for each repo) """ counts = {} for target in targets: counts[target] = [0] * len(...
def get_package_counts(package_descriptors, targets, repos_data): """ Get the number of packages per target and repository. :return: a dict indexed by targets containing a list of integer values (one for each repo) """ counts = {} for target in targets: counts[target] = [0] * len(...
[ "Get", "the", "number", "of", "packages", "per", "target", "and", "repository", "." ]
ros-infrastructure/ros_buildfarm
python
https://github.com/ros-infrastructure/ros_buildfarm/blob/c63ad85b21470f3262086fcd987528a0efc0cf6d/ros_buildfarm/status_page.py#L468-L486
[ "def", "get_package_counts", "(", "package_descriptors", ",", "targets", ",", "repos_data", ")", ":", "counts", "=", "{", "}", "for", "target", "in", "targets", ":", "counts", "[", "target", "]", "=", "[", "0", "]", "*", "len", "(", "repos_data", ")", ...
c63ad85b21470f3262086fcd987528a0efc0cf6d
valid
get_jenkins_job_urls
Get the Jenkins job urls for each target. The placeholder {pkg} needs to be replaced with the ROS package name. :return: a dict indexed by targets containing a string
ros_buildfarm/status_page.py
def get_jenkins_job_urls( rosdistro_name, jenkins_url, release_build_name, targets): """ Get the Jenkins job urls for each target. The placeholder {pkg} needs to be replaced with the ROS package name. :return: a dict indexed by targets containing a string """ urls = {} for target i...
def get_jenkins_job_urls( rosdistro_name, jenkins_url, release_build_name, targets): """ Get the Jenkins job urls for each target. The placeholder {pkg} needs to be replaced with the ROS package name. :return: a dict indexed by targets containing a string """ urls = {} for target i...
[ "Get", "the", "Jenkins", "job", "urls", "for", "each", "target", "." ]
ros-infrastructure/ros_buildfarm
python
https://github.com/ros-infrastructure/ros_buildfarm/blob/c63ad85b21470f3262086fcd987528a0efc0cf6d/ros_buildfarm/status_page.py#L489-L511
[ "def", "get_jenkins_job_urls", "(", "rosdistro_name", ",", "jenkins_url", ",", "release_build_name", ",", "targets", ")", ":", "urls", "=", "{", "}", "for", "target", "in", "targets", ":", "view_name", "=", "get_release_view_name", "(", "rosdistro_name", ",", "r...
c63ad85b21470f3262086fcd987528a0efc0cf6d
valid
configure_ci_jobs
Configure all Jenkins CI jobs.
ros_buildfarm/ci_job.py
def configure_ci_jobs( config_url, rosdistro_name, ci_build_name, groovy_script=None, dry_run=False): """Configure all Jenkins CI jobs.""" config = get_config_index(config_url) build_files = get_ci_build_files(config, rosdistro_name) build_file = build_files[ci_build_name] index = g...
def configure_ci_jobs( config_url, rosdistro_name, ci_build_name, groovy_script=None, dry_run=False): """Configure all Jenkins CI jobs.""" config = get_config_index(config_url) build_files = get_ci_build_files(config, rosdistro_name) build_file = build_files[ci_build_name] index = g...
[ "Configure", "all", "Jenkins", "CI", "jobs", "." ]
ros-infrastructure/ros_buildfarm
python
https://github.com/ros-infrastructure/ros_buildfarm/blob/c63ad85b21470f3262086fcd987528a0efc0cf6d/ros_buildfarm/ci_job.py#L36-L114
[ "def", "configure_ci_jobs", "(", "config_url", ",", "rosdistro_name", ",", "ci_build_name", ",", "groovy_script", "=", "None", ",", "dry_run", "=", "False", ")", ":", "config", "=", "get_config_index", "(", "config_url", ")", "build_files", "=", "get_ci_build_file...
c63ad85b21470f3262086fcd987528a0efc0cf6d
valid
configure_ci_job
Configure a single Jenkins CI job. This includes the following steps: - clone the ros_buildfarm repository - write the distribution repository keys into files - invoke the ci/run_ci_job.py script
ros_buildfarm/ci_job.py
def configure_ci_job( config_url, rosdistro_name, ci_build_name, os_name, os_code_name, arch, config=None, build_file=None, index=None, dist_file=None, jenkins=None, views=None, is_disabled=False, groovy_script=None, build_targets=None, dry_run=Fal...
def configure_ci_job( config_url, rosdistro_name, ci_build_name, os_name, os_code_name, arch, config=None, build_file=None, index=None, dist_file=None, jenkins=None, views=None, is_disabled=False, groovy_script=None, build_targets=None, dry_run=Fal...
[ "Configure", "a", "single", "Jenkins", "CI", "job", "." ]
ros-infrastructure/ros_buildfarm
python
https://github.com/ros-infrastructure/ros_buildfarm/blob/c63ad85b21470f3262086fcd987528a0efc0cf6d/ros_buildfarm/ci_job.py#L117-L206
[ "def", "configure_ci_job", "(", "config_url", ",", "rosdistro_name", ",", "ci_build_name", ",", "os_name", ",", "os_code_name", ",", "arch", ",", "config", "=", "None", ",", "build_file", "=", "None", ",", "index", "=", "None", ",", "dist_file", "=", "None",...
c63ad85b21470f3262086fcd987528a0efc0cf6d
valid
write_groovy_script_and_configs
Write out the groovy script and configs to file. This writes the reconfigure script to the file location and places the expanded configs in subdirectories 'view_configs' / 'job_configs' that the script can then access when run.
ros_buildfarm/common.py
def write_groovy_script_and_configs( filename, content, job_configs, view_configs=None): """Write out the groovy script and configs to file. This writes the reconfigure script to the file location and places the expanded configs in subdirectories 'view_configs' / 'job_configs' that the script c...
def write_groovy_script_and_configs( filename, content, job_configs, view_configs=None): """Write out the groovy script and configs to file. This writes the reconfigure script to the file location and places the expanded configs in subdirectories 'view_configs' / 'job_configs' that the script c...
[ "Write", "out", "the", "groovy", "script", "and", "configs", "to", "file", "." ]
ros-infrastructure/ros_buildfarm
python
https://github.com/ros-infrastructure/ros_buildfarm/blob/c63ad85b21470f3262086fcd987528a0efc0cf6d/ros_buildfarm/common.py#L434-L466
[ "def", "write_groovy_script_and_configs", "(", "filename", ",", "content", ",", "job_configs", ",", "view_configs", "=", "None", ")", ":", "with", "open", "(", "filename", ",", "'w'", ")", "as", "h", ":", "h", ".", "write", "(", "content", ")", "if", "vi...
c63ad85b21470f3262086fcd987528a0efc0cf6d
valid
topological_order_packages
Order packages topologically. First returning packages which have message generators and then the rest based on all direct depends and indirect recursive run_depends. :param packages: A dict mapping relative paths to ``Package`` objects ``dict`` :returns: A list of tuples containing the relative path ...
ros_buildfarm/common.py
def topological_order_packages(packages): """ Order packages topologically. First returning packages which have message generators and then the rest based on all direct depends and indirect recursive run_depends. :param packages: A dict mapping relative paths to ``Package`` objects ``dict`` :r...
def topological_order_packages(packages): """ Order packages topologically. First returning packages which have message generators and then the rest based on all direct depends and indirect recursive run_depends. :param packages: A dict mapping relative paths to ``Package`` objects ``dict`` :r...
[ "Order", "packages", "topologically", "." ]
ros-infrastructure/ros_buildfarm
python
https://github.com/ros-infrastructure/ros_buildfarm/blob/c63ad85b21470f3262086fcd987528a0efc0cf6d/ros_buildfarm/common.py#L469-L507
[ "def", "topological_order_packages", "(", "packages", ")", ":", "from", "catkin_pkg", ".", "topological_order", "import", "_PackageDecorator", "from", "catkin_pkg", ".", "topological_order", "import", "_sort_decorated_packages", "decorators_by_name", "=", "{", "}", "for",...
c63ad85b21470f3262086fcd987528a0efc0cf6d
valid
parse_public
Loads a public key from a DER or PEM-formatted file. Supports RSA, DSA and EC public keys. For RSA keys, both the old RSAPublicKey and SubjectPublicKeyInfo structures are supported. Also allows extracting a public key from an X.509 certificate. :param data: A byte string to load the public key ...
oscrypto/keys.py
def parse_public(data): """ Loads a public key from a DER or PEM-formatted file. Supports RSA, DSA and EC public keys. For RSA keys, both the old RSAPublicKey and SubjectPublicKeyInfo structures are supported. Also allows extracting a public key from an X.509 certificate. :param data: A...
def parse_public(data): """ Loads a public key from a DER or PEM-formatted file. Supports RSA, DSA and EC public keys. For RSA keys, both the old RSAPublicKey and SubjectPublicKeyInfo structures are supported. Also allows extracting a public key from an X.509 certificate. :param data: A...
[ "Loads", "a", "public", "key", "from", "a", "DER", "or", "PEM", "-", "formatted", "file", ".", "Supports", "RSA", "DSA", "and", "EC", "public", "keys", ".", "For", "RSA", "keys", "both", "the", "old", "RSAPublicKey", "and", "SubjectPublicKeyInfo", "structu...
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/keys.py#L41-L111
[ "def", "parse_public", "(", "data", ")", ":", "if", "not", "isinstance", "(", "data", ",", "byte_cls", ")", ":", "raise", "TypeError", "(", "pretty_message", "(", "'''\n data must be a byte string, not %s\n '''", ",", "type_name", "(", "data", ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
parse_certificate
Loads a certificate from a DER or PEM-formatted file. Supports X.509 certificates only. :param data: A byte string to load the certificate from :raises: ValueError - when the data does not appear to contain a certificate :return: An asn1crypto.x509.Certificate object
oscrypto/keys.py
def parse_certificate(data): """ Loads a certificate from a DER or PEM-formatted file. Supports X.509 certificates only. :param data: A byte string to load the certificate from :raises: ValueError - when the data does not appear to contain a certificate :return: An asn...
def parse_certificate(data): """ Loads a certificate from a DER or PEM-formatted file. Supports X.509 certificates only. :param data: A byte string to load the certificate from :raises: ValueError - when the data does not appear to contain a certificate :return: An asn...
[ "Loads", "a", "certificate", "from", "a", "DER", "or", "PEM", "-", "formatted", "file", ".", "Supports", "X", ".", "509", "certificates", "only", "." ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/keys.py#L114-L169
[ "def", "parse_certificate", "(", "data", ")", ":", "if", "not", "isinstance", "(", "data", ",", "byte_cls", ")", ":", "raise", "TypeError", "(", "pretty_message", "(", "'''\n data must be a byte string, not %s\n '''", ",", "type_name", "(", "data...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
parse_private
Loads a private key from a DER or PEM-formatted file. Supports RSA, DSA and EC private keys. Works with the follow formats: - RSAPrivateKey (PKCS#1) - ECPrivateKey (SECG SEC1 V2) - DSAPrivateKey (OpenSSL) - PrivateKeyInfo (RSA/DSA/EC - PKCS#8) - EncryptedPrivateKeyInfo (RSA/DSA/EC - PKCS#8...
oscrypto/keys.py
def parse_private(data, password=None): """ Loads a private key from a DER or PEM-formatted file. Supports RSA, DSA and EC private keys. Works with the follow formats: - RSAPrivateKey (PKCS#1) - ECPrivateKey (SECG SEC1 V2) - DSAPrivateKey (OpenSSL) - PrivateKeyInfo (RSA/DSA/EC - PKCS#8)...
def parse_private(data, password=None): """ Loads a private key from a DER or PEM-formatted file. Supports RSA, DSA and EC private keys. Works with the follow formats: - RSAPrivateKey (PKCS#1) - ECPrivateKey (SECG SEC1 V2) - DSAPrivateKey (OpenSSL) - PrivateKeyInfo (RSA/DSA/EC - PKCS#8)...
[ "Loads", "a", "private", "key", "from", "a", "DER", "or", "PEM", "-", "formatted", "file", ".", "Supports", "RSA", "DSA", "and", "EC", "private", "keys", ".", "Works", "with", "the", "follow", "formats", ":" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/keys.py#L172-L286
[ "def", "parse_private", "(", "data", ",", "password", "=", "None", ")", ":", "if", "not", "isinstance", "(", "data", ",", "byte_cls", ")", ":", "raise", "TypeError", "(", "pretty_message", "(", "'''\n data must be a byte string, not %s\n '''", ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_unarmor_pem
Removes PEM-encoding from a public key, private key or certificate. If the private key is encrypted, the password will be used to decrypt it. :param data: A byte string of the PEM-encoded data :param password: A byte string of the encryption password, or None :return: A 3-elem...
oscrypto/keys.py
def _unarmor_pem(data, password=None): """ Removes PEM-encoding from a public key, private key or certificate. If the private key is encrypted, the password will be used to decrypt it. :param data: A byte string of the PEM-encoded data :param password: A byte string of the encrypti...
def _unarmor_pem(data, password=None): """ Removes PEM-encoding from a public key, private key or certificate. If the private key is encrypted, the password will be used to decrypt it. :param data: A byte string of the PEM-encoded data :param password: A byte string of the encrypti...
[ "Removes", "PEM", "-", "encoding", "from", "a", "public", "key", "private", "key", "or", "certificate", ".", "If", "the", "private", "key", "is", "encrypted", "the", "password", "will", "be", "used", "to", "decrypt", "it", "." ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/keys.py#L289-L337
[ "def", "_unarmor_pem", "(", "data", ",", "password", "=", "None", ")", ":", "object_type", ",", "headers", ",", "der_bytes", "=", "pem", ".", "unarmor", "(", "data", ")", "type_regex", "=", "'^((DSA|EC|RSA) PRIVATE KEY|ENCRYPTED PRIVATE KEY|PRIVATE KEY|PUBLIC KEY|RSA ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_unarmor_pem_openssl_private
Parses a PKCS#1 private key, or encrypted private key :param headers: A dict of "Name: Value" lines from right after the PEM header :param data: A byte string of the DER-encoded PKCS#1 private key :param password: A byte string of the password to use if the private key is encrypte...
oscrypto/keys.py
def _unarmor_pem_openssl_private(headers, data, password): """ Parses a PKCS#1 private key, or encrypted private key :param headers: A dict of "Name: Value" lines from right after the PEM header :param data: A byte string of the DER-encoded PKCS#1 private key :param password: ...
def _unarmor_pem_openssl_private(headers, data, password): """ Parses a PKCS#1 private key, or encrypted private key :param headers: A dict of "Name: Value" lines from right after the PEM header :param data: A byte string of the DER-encoded PKCS#1 private key :param password: ...
[ "Parses", "a", "PKCS#1", "private", "key", "or", "encrypted", "private", "key" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/keys.py#L340-L428
[ "def", "_unarmor_pem_openssl_private", "(", "headers", ",", "data", ",", "password", ")", ":", "enc_algo", "=", "None", "enc_iv_hex", "=", "None", "enc_iv", "=", "None", "if", "'DEK-Info'", "in", "headers", ":", "params", "=", "headers", "[", "'DEK-Info'", "...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
parse_pkcs12
Parses a PKCS#12 ANS.1 DER-encoded structure and extracts certs and keys :param data: A byte string of a DER-encoded PKCS#12 file :param password: A byte string of the password to any encrypted data :raises: ValueError - when any of the parameters are of the wrong type or value ...
oscrypto/keys.py
def parse_pkcs12(data, password=None): """ Parses a PKCS#12 ANS.1 DER-encoded structure and extracts certs and keys :param data: A byte string of a DER-encoded PKCS#12 file :param password: A byte string of the password to any encrypted data :raises: ValueError - when any ...
def parse_pkcs12(data, password=None): """ Parses a PKCS#12 ANS.1 DER-encoded structure and extracts certs and keys :param data: A byte string of a DER-encoded PKCS#12 file :param password: A byte string of the password to any encrypted data :raises: ValueError - when any ...
[ "Parses", "a", "PKCS#12", "ANS", ".", "1", "DER", "-", "encoded", "structure", "and", "extracts", "certs", "and", "keys" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/keys.py#L431-L562
[ "def", "parse_pkcs12", "(", "data", ",", "password", "=", "None", ")", ":", "if", "not", "isinstance", "(", "data", ",", "byte_cls", ")", ":", "raise", "TypeError", "(", "pretty_message", "(", "'''\n data must be a byte string, not %s\n '''", "...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_parse_safe_contents
Parses a SafeContents PKCS#12 ANS.1 structure and extracts certs and keys :param safe_contents: A byte string of ber-encoded SafeContents, or a asn1crypto.pkcs12.SafeContents parsed object :param certs: A dict to store certificates in :param keys: A dict to store keys in ...
oscrypto/keys.py
def _parse_safe_contents(safe_contents, certs, private_keys, password): """ Parses a SafeContents PKCS#12 ANS.1 structure and extracts certs and keys :param safe_contents: A byte string of ber-encoded SafeContents, or a asn1crypto.pkcs12.SafeContents parsed object :param certs: ...
def _parse_safe_contents(safe_contents, certs, private_keys, password): """ Parses a SafeContents PKCS#12 ANS.1 structure and extracts certs and keys :param safe_contents: A byte string of ber-encoded SafeContents, or a asn1crypto.pkcs12.SafeContents parsed object :param certs: ...
[ "Parses", "a", "SafeContents", "PKCS#12", "ANS", ".", "1", "structure", "and", "extracts", "certs", "and", "keys" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/keys.py#L565-L610
[ "def", "_parse_safe_contents", "(", "safe_contents", ",", "certs", ",", "private_keys", ",", "password", ")", ":", "if", "isinstance", "(", "safe_contents", ",", "byte_cls", ")", ":", "safe_contents", "=", "pkcs12", ".", "SafeContents", ".", "load", "(", "safe...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_decrypt_encrypted_data
Decrypts encrypted ASN.1 data :param encryption_algorithm_info: An instance of asn1crypto.pkcs5.Pkcs5EncryptionAlgorithm :param encrypted_content: A byte string of the encrypted content :param password: A byte string of the encrypted content's password :return: A byte...
oscrypto/keys.py
def _decrypt_encrypted_data(encryption_algorithm_info, encrypted_content, password): """ Decrypts encrypted ASN.1 data :param encryption_algorithm_info: An instance of asn1crypto.pkcs5.Pkcs5EncryptionAlgorithm :param encrypted_content: A byte string of the encrypted content :param...
def _decrypt_encrypted_data(encryption_algorithm_info, encrypted_content, password): """ Decrypts encrypted ASN.1 data :param encryption_algorithm_info: An instance of asn1crypto.pkcs5.Pkcs5EncryptionAlgorithm :param encrypted_content: A byte string of the encrypted content :param...
[ "Decrypts", "encrypted", "ASN", ".", "1", "data" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/keys.py#L613-L691
[ "def", "_decrypt_encrypted_data", "(", "encryption_algorithm_info", ",", "encrypted_content", ",", "password", ")", ":", "decrypt_func", "=", "crypto_funcs", "[", "encryption_algorithm_info", ".", "encryption_cipher", "]", "# Modern, PKCS#5 PBES2-based encryption", "if", "enc...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
aes_cbc_no_padding_decrypt
Decrypts AES ciphertext in CBC mode using a 128, 192 or 256 bit key and no padding. :param key: The encryption key - a byte string either 16, 24 or 32 bytes long :param data: The ciphertext - a byte string :param iv: The initialization vector - a byte string 16-bytes long ...
oscrypto/_openssl/symmetric.py
def aes_cbc_no_padding_decrypt(key, data, iv): """ Decrypts AES ciphertext in CBC mode using a 128, 192 or 256 bit key and no padding. :param key: The encryption key - a byte string either 16, 24 or 32 bytes long :param data: The ciphertext - a byte string :param iv: T...
def aes_cbc_no_padding_decrypt(key, data, iv): """ Decrypts AES ciphertext in CBC mode using a 128, 192 or 256 bit key and no padding. :param key: The encryption key - a byte string either 16, 24 or 32 bytes long :param data: The ciphertext - a byte string :param iv: T...
[ "Decrypts", "AES", "ciphertext", "in", "CBC", "mode", "using", "a", "128", "192", "or", "256", "bit", "key", "and", "no", "padding", "." ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/symmetric.py#L77-L110
[ "def", "aes_cbc_no_padding_decrypt", "(", "key", ",", "data", ",", "iv", ")", ":", "cipher", "=", "_calculate_aes_cipher", "(", "key", ")", "if", "len", "(", "iv", ")", "!=", "16", ":", "raise", "ValueError", "(", "pretty_message", "(", "'''\n iv ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
aes_cbc_pkcs7_encrypt
Encrypts plaintext using AES in CBC mode with a 128, 192 or 256 bit key and PKCS#7 padding. :param key: The encryption key - a byte string either 16, 24 or 32 bytes long :param data: The plaintext - a byte string :param iv: The initialization vector - either a byte string 16-b...
oscrypto/_openssl/symmetric.py
def aes_cbc_pkcs7_encrypt(key, data, iv): """ Encrypts plaintext using AES in CBC mode with a 128, 192 or 256 bit key and PKCS#7 padding. :param key: The encryption key - a byte string either 16, 24 or 32 bytes long :param data: The plaintext - a byte string :param iv: ...
def aes_cbc_pkcs7_encrypt(key, data, iv): """ Encrypts plaintext using AES in CBC mode with a 128, 192 or 256 bit key and PKCS#7 padding. :param key: The encryption key - a byte string either 16, 24 or 32 bytes long :param data: The plaintext - a byte string :param iv: ...
[ "Encrypts", "plaintext", "using", "AES", "in", "CBC", "mode", "with", "a", "128", "192", "or", "256", "bit", "key", "and", "PKCS#7", "padding", "." ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/symmetric.py#L113-L149
[ "def", "aes_cbc_pkcs7_encrypt", "(", "key", ",", "data", ",", "iv", ")", ":", "cipher", "=", "_calculate_aes_cipher", "(", "key", ")", "if", "not", "iv", ":", "iv", "=", "rand_bytes", "(", "16", ")", "elif", "len", "(", "iv", ")", "!=", "16", ":", ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
aes_cbc_pkcs7_decrypt
Decrypts AES ciphertext in CBC mode using a 128, 192 or 256 bit key :param key: The encryption key - a byte string either 16, 24 or 32 bytes long :param data: The ciphertext - a byte string :param iv: The initialization vector - a byte string 16-bytes long :raises: Va...
oscrypto/_openssl/symmetric.py
def aes_cbc_pkcs7_decrypt(key, data, iv): """ Decrypts AES ciphertext in CBC mode using a 128, 192 or 256 bit key :param key: The encryption key - a byte string either 16, 24 or 32 bytes long :param data: The ciphertext - a byte string :param iv: The initialization vector ...
def aes_cbc_pkcs7_decrypt(key, data, iv): """ Decrypts AES ciphertext in CBC mode using a 128, 192 or 256 bit key :param key: The encryption key - a byte string either 16, 24 or 32 bytes long :param data: The ciphertext - a byte string :param iv: The initialization vector ...
[ "Decrypts", "AES", "ciphertext", "in", "CBC", "mode", "using", "a", "128", "192", "or", "256", "bit", "key" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/symmetric.py#L152-L184
[ "def", "aes_cbc_pkcs7_decrypt", "(", "key", ",", "data", ",", "iv", ")", ":", "cipher", "=", "_calculate_aes_cipher", "(", "key", ")", "if", "len", "(", "iv", ")", "!=", "16", ":", "raise", "ValueError", "(", "pretty_message", "(", "'''\n iv must ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_calculate_aes_cipher
Determines if the key is a valid AES 128, 192 or 256 key :param key: A byte string of the key to use :raises: ValueError - when an invalid key is provided :return: A unicode string of the AES variation - "aes128", "aes192" or "aes256"
oscrypto/_openssl/symmetric.py
def _calculate_aes_cipher(key): """ Determines if the key is a valid AES 128, 192 or 256 key :param key: A byte string of the key to use :raises: ValueError - when an invalid key is provided :return: A unicode string of the AES variation - "aes128", "aes192" or "aes256" ...
def _calculate_aes_cipher(key): """ Determines if the key is a valid AES 128, 192 or 256 key :param key: A byte string of the key to use :raises: ValueError - when an invalid key is provided :return: A unicode string of the AES variation - "aes128", "aes192" or "aes256" ...
[ "Determines", "if", "the", "key", "is", "a", "valid", "AES", "128", "192", "or", "256", "key" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/symmetric.py#L187-L217
[ "def", "_calculate_aes_cipher", "(", "key", ")", ":", "if", "len", "(", "key", ")", "not", "in", "[", "16", ",", "24", ",", "32", "]", ":", "raise", "ValueError", "(", "pretty_message", "(", "'''\n key must be either 16, 24 or 32 bytes (128, 192 or 256 ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
rc4_encrypt
Encrypts plaintext using RC4 with a 40-128 bit key :param key: The encryption key - a byte string 5-16 bytes long :param data: The plaintext - a byte string :raises: ValueError - when any of the parameters contain an invalid value TypeError - when any of the parameters are...
oscrypto/_openssl/symmetric.py
def rc4_encrypt(key, data): """ Encrypts plaintext using RC4 with a 40-128 bit key :param key: The encryption key - a byte string 5-16 bytes long :param data: The plaintext - a byte string :raises: ValueError - when any of the parameters contain an invalid value Ty...
def rc4_encrypt(key, data): """ Encrypts plaintext using RC4 with a 40-128 bit key :param key: The encryption key - a byte string 5-16 bytes long :param data: The plaintext - a byte string :raises: ValueError - when any of the parameters contain an invalid value Ty...
[ "Encrypts", "plaintext", "using", "RC4", "with", "a", "40", "-", "128", "bit", "key" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/symmetric.py#L220-L247
[ "def", "rc4_encrypt", "(", "key", ",", "data", ")", ":", "if", "len", "(", "key", ")", "<", "5", "or", "len", "(", "key", ")", ">", "16", ":", "raise", "ValueError", "(", "pretty_message", "(", "'''\n key must be 5 to 16 bytes (40 to 128 bits) long ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
rc4_decrypt
Decrypts RC4 ciphertext using a 40-128 bit key :param key: The encryption key - a byte string 5-16 bytes long :param data: The ciphertext - a byte string :raises: ValueError - when any of the parameters contain an invalid value TypeError - when any of the parameters are of...
oscrypto/_openssl/symmetric.py
def rc4_decrypt(key, data): """ Decrypts RC4 ciphertext using a 40-128 bit key :param key: The encryption key - a byte string 5-16 bytes long :param data: The ciphertext - a byte string :raises: ValueError - when any of the parameters contain an invalid value TypeE...
def rc4_decrypt(key, data): """ Decrypts RC4 ciphertext using a 40-128 bit key :param key: The encryption key - a byte string 5-16 bytes long :param data: The ciphertext - a byte string :raises: ValueError - when any of the parameters contain an invalid value TypeE...
[ "Decrypts", "RC4", "ciphertext", "using", "a", "40", "-", "128", "bit", "key" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/symmetric.py#L250-L277
[ "def", "rc4_decrypt", "(", "key", ",", "data", ")", ":", "if", "len", "(", "key", ")", "<", "5", "or", "len", "(", "key", ")", ">", "16", ":", "raise", "ValueError", "(", "pretty_message", "(", "'''\n key must be 5 to 16 bytes (40 to 128 bits) long ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
tripledes_cbc_pkcs5_decrypt
Decrypts 3DES ciphertext in CBC mode using either the 2 or 3 key variant (16 or 24 byte long key) and PKCS#5 padding. :param key: The encryption key - a byte string 16 or 24 bytes long (2 or 3 key mode) :param data: The ciphertext - a byte string :param iv: The initialization ...
oscrypto/_openssl/symmetric.py
def tripledes_cbc_pkcs5_decrypt(key, data, iv): """ Decrypts 3DES ciphertext in CBC mode using either the 2 or 3 key variant (16 or 24 byte long key) and PKCS#5 padding. :param key: The encryption key - a byte string 16 or 24 bytes long (2 or 3 key mode) :param data: The ciphertext...
def tripledes_cbc_pkcs5_decrypt(key, data, iv): """ Decrypts 3DES ciphertext in CBC mode using either the 2 or 3 key variant (16 or 24 byte long key) and PKCS#5 padding. :param key: The encryption key - a byte string 16 or 24 bytes long (2 or 3 key mode) :param data: The ciphertext...
[ "Decrypts", "3DES", "ciphertext", "in", "CBC", "mode", "using", "either", "the", "2", "or", "3", "key", "variant", "(", "16", "or", "24", "byte", "long", "key", ")", "and", "PKCS#5", "padding", "." ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/symmetric.py#L418-L463
[ "def", "tripledes_cbc_pkcs5_decrypt", "(", "key", ",", "data", ",", "iv", ")", ":", "if", "len", "(", "key", ")", "!=", "16", "and", "len", "(", "key", ")", "!=", "24", ":", "raise", "ValueError", "(", "pretty_message", "(", "'''\n key must be 1...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
des_cbc_pkcs5_decrypt
Decrypts DES ciphertext in CBC mode using a 56 bit key and PKCS#5 padding. :param key: The encryption key - a byte string 8 bytes long (includes error correction bits) :param data: The ciphertext - a byte string :param iv: The initialization vector - a byte string 8-bytes long ...
oscrypto/_openssl/symmetric.py
def des_cbc_pkcs5_decrypt(key, data, iv): """ Decrypts DES ciphertext in CBC mode using a 56 bit key and PKCS#5 padding. :param key: The encryption key - a byte string 8 bytes long (includes error correction bits) :param data: The ciphertext - a byte string :param iv: The ...
def des_cbc_pkcs5_decrypt(key, data, iv): """ Decrypts DES ciphertext in CBC mode using a 56 bit key and PKCS#5 padding. :param key: The encryption key - a byte string 8 bytes long (includes error correction bits) :param data: The ciphertext - a byte string :param iv: The ...
[ "Decrypts", "DES", "ciphertext", "in", "CBC", "mode", "using", "a", "56", "bit", "key", "and", "PKCS#5", "padding", "." ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/symmetric.py#L511-L549
[ "def", "des_cbc_pkcs5_decrypt", "(", "key", ",", "data", ",", "iv", ")", ":", "if", "len", "(", "key", ")", "!=", "8", ":", "raise", "ValueError", "(", "pretty_message", "(", "'''\n key must be 8 bytes (56 bits + 8 parity bits) long - is %s\n '''",...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_encrypt
Encrypts plaintext :param cipher: A unicode string of "aes128", "aes192", "aes256", "des", "tripledes_2key", "tripledes_3key", "rc2", "rc4" :param key: The encryption key - a byte string 5-32 bytes long :param data: The plaintext - a byte string :param iv: The...
oscrypto/_openssl/symmetric.py
def _encrypt(cipher, key, data, iv, padding): """ Encrypts plaintext :param cipher: A unicode string of "aes128", "aes192", "aes256", "des", "tripledes_2key", "tripledes_3key", "rc2", "rc4" :param key: The encryption key - a byte string 5-32 bytes long :param data: ...
def _encrypt(cipher, key, data, iv, padding): """ Encrypts plaintext :param cipher: A unicode string of "aes128", "aes192", "aes256", "des", "tripledes_2key", "tripledes_3key", "rc2", "rc4" :param key: The encryption key - a byte string 5-32 bytes long :param data: ...
[ "Encrypts", "plaintext" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/symmetric.py#L552-L659
[ "def", "_encrypt", "(", "cipher", ",", "key", ",", "data", ",", "iv", ",", "padding", ")", ":", "if", "not", "isinstance", "(", "key", ",", "byte_cls", ")", ":", "raise", "TypeError", "(", "pretty_message", "(", "'''\n key must be a byte string, not...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_setup_evp_encrypt_decrypt
Creates an EVP_CIPHER pointer object and determines the buffer size necessary for the parameter specified. :param evp_cipher_ctx: An EVP_CIPHER_CTX pointer :param cipher: A unicode string of "aes128", "aes192", "aes256", "des", "tripledes_2key", "tripledes_3key", "rc2", "rc4" ...
oscrypto/_openssl/symmetric.py
def _setup_evp_encrypt_decrypt(cipher, data): """ Creates an EVP_CIPHER pointer object and determines the buffer size necessary for the parameter specified. :param evp_cipher_ctx: An EVP_CIPHER_CTX pointer :param cipher: A unicode string of "aes128", "aes192", "aes256", "des", ...
def _setup_evp_encrypt_decrypt(cipher, data): """ Creates an EVP_CIPHER pointer object and determines the buffer size necessary for the parameter specified. :param evp_cipher_ctx: An EVP_CIPHER_CTX pointer :param cipher: A unicode string of "aes128", "aes192", "aes256", "des", ...
[ "Creates", "an", "EVP_CIPHER", "pointer", "object", "and", "determines", "the", "buffer", "size", "necessary", "for", "the", "parameter", "specified", "." ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/symmetric.py#L772-L823
[ "def", "_setup_evp_encrypt_decrypt", "(", "cipher", ",", "data", ")", ":", "evp_cipher", "=", "{", "'aes128'", ":", "libcrypto", ".", "EVP_aes_128_cbc", ",", "'aes192'", ":", "libcrypto", ".", "EVP_aes_192_cbc", ",", "'aes256'", ":", "libcrypto", ".", "EVP_aes_2...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
handle_error
Extracts the last Windows error message into a python unicode string :param result: A function result, 0 or None indicates failure :return: A unicode string error message
oscrypto/_win/_crypt32.py
def handle_error(result): """ Extracts the last Windows error message into a python unicode string :param result: A function result, 0 or None indicates failure :return: A unicode string error message """ if result: return _, error_string = get_error() if not...
def handle_error(result): """ Extracts the last Windows error message into a python unicode string :param result: A function result, 0 or None indicates failure :return: A unicode string error message """ if result: return _, error_string = get_error() if not...
[ "Extracts", "the", "last", "Windows", "error", "message", "into", "a", "python", "unicode", "string" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/_crypt32.py#L21-L40
[ "def", "handle_error", "(", "result", ")", ":", "if", "result", ":", "return", "_", ",", "error_string", "=", "get_error", "(", ")", "if", "not", "isinstance", "(", "error_string", ",", "str_cls", ")", ":", "error_string", "=", "_try_decode", "(", "error_s...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
handle_error
Extracts the last Windows error message into a python unicode string :param result: A function result, 0 or None indicates failure :param exception_class: The exception class to use for the exception if an error occurred :return: A unicode string error message
oscrypto/_win/_secur32.py
def handle_error(result, exception_class=None): """ Extracts the last Windows error message into a python unicode string :param result: A function result, 0 or None indicates failure :param exception_class: The exception class to use for the exception if an error occurred :return:...
def handle_error(result, exception_class=None): """ Extracts the last Windows error message into a python unicode string :param result: A function result, 0 or None indicates failure :param exception_class: The exception class to use for the exception if an error occurred :return:...
[ "Extracts", "the", "last", "Windows", "error", "message", "into", "a", "python", "unicode", "string" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/_secur32.py#L22-L56
[ "def", "handle_error", "(", "result", ",", "exception_class", "=", "None", ")", ":", "if", "result", "==", "0", ":", "return", "if", "result", "==", "Secur32Const", ".", "SEC_E_OUT_OF_SEQUENCE", ":", "raise", "TLSError", "(", "'A packet was received out of order'"...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
generate_pair
Generates a public/private key pair :param algorithm: The key algorithm - "rsa", "dsa" or "ec" :param bit_size: An integer - used for "rsa" and "dsa". For "rsa" the value maye be 1024, 2048, 3072 or 4096. For "dsa" the value may be 1024, plus 2048 or 3072 if OpenSSL 1.0.0 or ne...
oscrypto/_openssl/asymmetric.py
def generate_pair(algorithm, bit_size=None, curve=None): """ Generates a public/private key pair :param algorithm: The key algorithm - "rsa", "dsa" or "ec" :param bit_size: An integer - used for "rsa" and "dsa". For "rsa" the value maye be 1024, 2048, 3072 or 4096. For "dsa" th...
def generate_pair(algorithm, bit_size=None, curve=None): """ Generates a public/private key pair :param algorithm: The key algorithm - "rsa", "dsa" or "ec" :param bit_size: An integer - used for "rsa" and "dsa". For "rsa" the value maye be 1024, 2048, 3072 or 4096. For "dsa" th...
[ "Generates", "a", "public", "/", "private", "key", "pair" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/asymmetric.py#L273-L476
[ "def", "generate_pair", "(", "algorithm", ",", "bit_size", "=", "None", ",", "curve", "=", "None", ")", ":", "if", "algorithm", "not", "in", "set", "(", "[", "'rsa'", ",", "'dsa'", ",", "'ec'", "]", ")", ":", "raise", "ValueError", "(", "pretty_message...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
generate_dh_parameters
Generates DH parameters for use with Diffie-Hellman key exchange. Returns a structure in the format of DHParameter defined in PKCS#3, which is also used by the OpenSSL dhparam tool. THIS CAN BE VERY TIME CONSUMING! :param bit_size: The integer bit size of the parameters to generate. Must be be...
oscrypto/_openssl/asymmetric.py
def generate_dh_parameters(bit_size): """ Generates DH parameters for use with Diffie-Hellman key exchange. Returns a structure in the format of DHParameter defined in PKCS#3, which is also used by the OpenSSL dhparam tool. THIS CAN BE VERY TIME CONSUMING! :param bit_size: The integer ...
def generate_dh_parameters(bit_size): """ Generates DH parameters for use with Diffie-Hellman key exchange. Returns a structure in the format of DHParameter defined in PKCS#3, which is also used by the OpenSSL dhparam tool. THIS CAN BE VERY TIME CONSUMING! :param bit_size: The integer ...
[ "Generates", "DH", "parameters", "for", "use", "with", "Diffie", "-", "Hellman", "key", "exchange", ".", "Returns", "a", "structure", "in", "the", "format", "of", "DHParameter", "defined", "in", "PKCS#3", "which", "is", "also", "used", "by", "the", "OpenSSL"...
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/asymmetric.py#L482-L546
[ "def", "generate_dh_parameters", "(", "bit_size", ")", ":", "if", "not", "isinstance", "(", "bit_size", ",", "int_types", ")", ":", "raise", "TypeError", "(", "pretty_message", "(", "'''\n bit_size must be an integer, not %s\n '''", ",", "type_name",...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
load_certificate
Loads an x509 certificate into a Certificate object :param source: A byte string of file contents, a unicode string filename or an asn1crypto.x509.Certificate object :raises: ValueError - when any of the parameters contain an invalid value TypeError - when any of the parameters...
oscrypto/_openssl/asymmetric.py
def load_certificate(source): """ Loads an x509 certificate into a Certificate object :param source: A byte string of file contents, a unicode string filename or an asn1crypto.x509.Certificate object :raises: ValueError - when any of the parameters contain an invalid value ...
def load_certificate(source): """ Loads an x509 certificate into a Certificate object :param source: A byte string of file contents, a unicode string filename or an asn1crypto.x509.Certificate object :raises: ValueError - when any of the parameters contain an invalid value ...
[ "Loads", "an", "x509", "certificate", "into", "a", "Certificate", "object" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/asymmetric.py#L552-L588
[ "def", "load_certificate", "(", "source", ")", ":", "if", "isinstance", "(", "source", ",", "asn1x509", ".", "Certificate", ")", ":", "certificate", "=", "source", "elif", "isinstance", "(", "source", ",", "byte_cls", ")", ":", "certificate", "=", "parse_cer...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_load_x509
Loads an ASN.1 object of an x509 certificate into a Certificate object :param certificate: An asn1crypto.x509.Certificate object :return: A Certificate object
oscrypto/_openssl/asymmetric.py
def _load_x509(certificate): """ Loads an ASN.1 object of an x509 certificate into a Certificate object :param certificate: An asn1crypto.x509.Certificate object :return: A Certificate object """ source = certificate.dump() buffer = buffer_from_bytes(source) evp_pkey ...
def _load_x509(certificate): """ Loads an ASN.1 object of an x509 certificate into a Certificate object :param certificate: An asn1crypto.x509.Certificate object :return: A Certificate object """ source = certificate.dump() buffer = buffer_from_bytes(source) evp_pkey ...
[ "Loads", "an", "ASN", ".", "1", "object", "of", "an", "x509", "certificate", "into", "a", "Certificate", "object" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/asymmetric.py#L591-L608
[ "def", "_load_x509", "(", "certificate", ")", ":", "source", "=", "certificate", ".", "dump", "(", ")", "buffer", "=", "buffer_from_bytes", "(", "source", ")", "evp_pkey", "=", "libcrypto", ".", "d2i_X509", "(", "null", "(", ")", ",", "buffer_pointer", "("...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
load_private_key
Loads a private key into a PrivateKey object :param source: A byte string of file contents, a unicode string filename or an asn1crypto.keys.PrivateKeyInfo object :param password: A byte or unicode string to decrypt the private key file. Unicode strings will be encoded using UTF...
oscrypto/_openssl/asymmetric.py
def load_private_key(source, password=None): """ Loads a private key into a PrivateKey object :param source: A byte string of file contents, a unicode string filename or an asn1crypto.keys.PrivateKeyInfo object :param password: A byte or unicode string to decrypt the private ke...
def load_private_key(source, password=None): """ Loads a private key into a PrivateKey object :param source: A byte string of file contents, a unicode string filename or an asn1crypto.keys.PrivateKeyInfo object :param password: A byte or unicode string to decrypt the private ke...
[ "Loads", "a", "private", "key", "into", "a", "PrivateKey", "object" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/asymmetric.py#L611-L664
[ "def", "load_private_key", "(", "source", ",", "password", "=", "None", ")", ":", "if", "isinstance", "(", "source", ",", "keys", ".", "PrivateKeyInfo", ")", ":", "private_object", "=", "source", "else", ":", "if", "password", "is", "not", "None", ":", "...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
load_public_key
Loads a public key into a PublicKey object :param source: A byte string of file contents, a unicode string filename or an asn1crypto.keys.PublicKeyInfo object :raises: ValueError - when any of the parameters contain an invalid value TypeError - when any of the parameters are of...
oscrypto/_openssl/asymmetric.py
def load_public_key(source): """ Loads a public key into a PublicKey object :param source: A byte string of file contents, a unicode string filename or an asn1crypto.keys.PublicKeyInfo object :raises: ValueError - when any of the parameters contain an invalid value Type...
def load_public_key(source): """ Loads a public key into a PublicKey object :param source: A byte string of file contents, a unicode string filename or an asn1crypto.keys.PublicKeyInfo object :raises: ValueError - when any of the parameters contain an invalid value Type...
[ "Loads", "a", "public", "key", "into", "a", "PublicKey", "object" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/asymmetric.py#L667-L726
[ "def", "load_public_key", "(", "source", ")", ":", "if", "isinstance", "(", "source", ",", "keys", ".", "PublicKeyInfo", ")", ":", "public_key", "=", "source", "elif", "isinstance", "(", "source", ",", "byte_cls", ")", ":", "public_key", "=", "parse_public",...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_load_key
Loads a private key into a PrivateKey object :param private_object: An asn1crypto.keys.PrivateKeyInfo object :return: A PrivateKey object
oscrypto/_openssl/asymmetric.py
def _load_key(private_object): """ Loads a private key into a PrivateKey object :param private_object: An asn1crypto.keys.PrivateKeyInfo object :return: A PrivateKey object """ if libcrypto_version_info < (1,) and private_object.algorithm == 'dsa' and private_object.hash_algo ...
def _load_key(private_object): """ Loads a private key into a PrivateKey object :param private_object: An asn1crypto.keys.PrivateKeyInfo object :return: A PrivateKey object """ if libcrypto_version_info < (1,) and private_object.algorithm == 'dsa' and private_object.hash_algo ...
[ "Loads", "a", "private", "key", "into", "a", "PrivateKey", "object" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/asymmetric.py#L729-L755
[ "def", "_load_key", "(", "private_object", ")", ":", "if", "libcrypto_version_info", "<", "(", "1", ",", ")", "and", "private_object", ".", "algorithm", "==", "'dsa'", "and", "private_object", ".", "hash_algo", "==", "'sha2'", ":", "raise", "AsymmetricKeyError",...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_encrypt
Encrypts plaintext using an RSA public key or certificate :param certificate_or_public_key: A PublicKey, Certificate or PrivateKey object :param data: The byte string to encrypt :param padding: The padding mode to use :raises: ValueError - when any of the parameters c...
oscrypto/_openssl/asymmetric.py
def _encrypt(certificate_or_public_key, data, padding): """ Encrypts plaintext using an RSA public key or certificate :param certificate_or_public_key: A PublicKey, Certificate or PrivateKey object :param data: The byte string to encrypt :param padding: The padding mode to...
def _encrypt(certificate_or_public_key, data, padding): """ Encrypts plaintext using an RSA public key or certificate :param certificate_or_public_key: A PublicKey, Certificate or PrivateKey object :param data: The byte string to encrypt :param padding: The padding mode to...
[ "Encrypts", "plaintext", "using", "an", "RSA", "public", "key", "or", "certificate" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/asymmetric.py#L912-L965
[ "def", "_encrypt", "(", "certificate_or_public_key", ",", "data", ",", "padding", ")", ":", "if", "not", "isinstance", "(", "certificate_or_public_key", ",", "(", "Certificate", ",", "PublicKey", ")", ")", ":", "raise", "TypeError", "(", "pretty_message", "(", ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_decrypt
Decrypts RSA ciphertext using a private key :param private_key: A PrivateKey object :param ciphertext: The ciphertext - a byte string :param padding: The padding mode to use :raises: ValueError - when any of the parameters contain an invalid value TypeError - ...
oscrypto/_openssl/asymmetric.py
def _decrypt(private_key, ciphertext, padding): """ Decrypts RSA ciphertext using a private key :param private_key: A PrivateKey object :param ciphertext: The ciphertext - a byte string :param padding: The padding mode to use :raises: ValueError - when any of ...
def _decrypt(private_key, ciphertext, padding): """ Decrypts RSA ciphertext using a private key :param private_key: A PrivateKey object :param ciphertext: The ciphertext - a byte string :param padding: The padding mode to use :raises: ValueError - when any of ...
[ "Decrypts", "RSA", "ciphertext", "using", "a", "private", "key" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/asymmetric.py#L968-L1020
[ "def", "_decrypt", "(", "private_key", ",", "ciphertext", ",", "padding", ")", ":", "if", "not", "isinstance", "(", "private_key", ",", "PrivateKey", ")", ":", "raise", "TypeError", "(", "pretty_message", "(", "'''\n private_key must be an instance of the P...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_verify
Verifies an RSA, DSA or ECDSA signature :param certificate_or_public_key: A Certificate or PublicKey instance to verify the signature with :param signature: A byte string of the signature to verify :param data: A byte string of the data the signature is for :param hash_algori...
oscrypto/_openssl/asymmetric.py
def _verify(certificate_or_public_key, signature, data, hash_algorithm, rsa_pss_padding=False): """ Verifies an RSA, DSA or ECDSA signature :param certificate_or_public_key: A Certificate or PublicKey instance to verify the signature with :param signature: A byte string of the signatur...
def _verify(certificate_or_public_key, signature, data, hash_algorithm, rsa_pss_padding=False): """ Verifies an RSA, DSA or ECDSA signature :param certificate_or_public_key: A Certificate or PublicKey instance to verify the signature with :param signature: A byte string of the signatur...
[ "Verifies", "an", "RSA", "DSA", "or", "ECDSA", "signature" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/asymmetric.py#L1168-L1436
[ "def", "_verify", "(", "certificate_or_public_key", ",", "signature", ",", "data", ",", "hash_algorithm", ",", "rsa_pss_padding", "=", "False", ")", ":", "if", "not", "isinstance", "(", "certificate_or_public_key", ",", "(", "Certificate", ",", "PublicKey", ")", ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
rsa_pkcs1v15_sign
Generates an RSASSA-PKCS-v1.5 signature. When the hash_algorithm is "raw", the operation is identical to RSA private key encryption. That is: the data is not hashed and no ASN.1 structure with an algorithm identifier of the hash algorithm is placed in the encrypted byte string. :param private_key:...
oscrypto/_openssl/asymmetric.py
def rsa_pkcs1v15_sign(private_key, data, hash_algorithm): """ Generates an RSASSA-PKCS-v1.5 signature. When the hash_algorithm is "raw", the operation is identical to RSA private key encryption. That is: the data is not hashed and no ASN.1 structure with an algorithm identifier of the hash algorith...
def rsa_pkcs1v15_sign(private_key, data, hash_algorithm): """ Generates an RSASSA-PKCS-v1.5 signature. When the hash_algorithm is "raw", the operation is identical to RSA private key encryption. That is: the data is not hashed and no ASN.1 structure with an algorithm identifier of the hash algorith...
[ "Generates", "an", "RSASSA", "-", "PKCS", "-", "v1", ".", "5", "signature", "." ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/asymmetric.py#L1439-L1475
[ "def", "rsa_pkcs1v15_sign", "(", "private_key", ",", "data", ",", "hash_algorithm", ")", ":", "if", "private_key", ".", "algorithm", "!=", "'rsa'", ":", "raise", "ValueError", "(", "pretty_message", "(", "'''\n The key specified is not an RSA private key, but %...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_sign
Generates an RSA, DSA or ECDSA signature :param private_key: The PrivateKey to generate the signature with :param data: A byte string of the data the signature is for :param hash_algorithm: A unicode string of "md5", "sha1", "sha224", "sha256", "sha384" or "sha512" :param rsa...
oscrypto/_openssl/asymmetric.py
def _sign(private_key, data, hash_algorithm, rsa_pss_padding=False): """ Generates an RSA, DSA or ECDSA signature :param private_key: The PrivateKey to generate the signature with :param data: A byte string of the data the signature is for :param hash_algorithm: A unicode ...
def _sign(private_key, data, hash_algorithm, rsa_pss_padding=False): """ Generates an RSA, DSA or ECDSA signature :param private_key: The PrivateKey to generate the signature with :param data: A byte string of the data the signature is for :param hash_algorithm: A unicode ...
[ "Generates", "an", "RSA", "DSA", "or", "ECDSA", "signature" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/asymmetric.py#L1580-L1853
[ "def", "_sign", "(", "private_key", ",", "data", ",", "hash_algorithm", ",", "rsa_pss_padding", "=", "False", ")", ":", "if", "not", "isinstance", "(", "private_key", ",", "PrivateKey", ")", ":", "raise", "TypeError", "(", "pretty_message", "(", "'''\n ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
Certificate.public_key
:return: The PublicKey object for the public key this certificate contains
oscrypto/_openssl/asymmetric.py
def public_key(self): """ :return: The PublicKey object for the public key this certificate contains """ if not self._public_key and self.x509: evp_pkey = libcrypto.X509_get_pubkey(self.x509) self._public_key = PublicKey(evp_pkey, self.asn1['tbs_certi...
def public_key(self): """ :return: The PublicKey object for the public key this certificate contains """ if not self._public_key and self.x509: evp_pkey = libcrypto.X509_get_pubkey(self.x509) self._public_key = PublicKey(evp_pkey, self.asn1['tbs_certi...
[ ":", "return", ":", "The", "PublicKey", "object", "for", "the", "public", "key", "this", "certificate", "contains" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_openssl/asymmetric.py#L208-L218
[ "def", "public_key", "(", "self", ")", ":", "if", "not", "self", ".", "_public_key", "and", "self", ".", "x509", ":", "evp_pkey", "=", "libcrypto", ".", "X509_get_pubkey", "(", "self", ".", "x509", ")", "self", ".", "_public_key", "=", "PublicKey", "(", ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
generate_pair
Generates a public/private key pair :param algorithm: The key algorithm - "rsa", "dsa" or "ec" :param bit_size: An integer - used for "rsa" and "dsa". For "rsa" the value maye be 1024, 2048, 3072 or 4096. For "dsa" the value may be 1024, plus 2048 or 3072 if on Windows 8 or new...
oscrypto/_win/asymmetric.py
def generate_pair(algorithm, bit_size=None, curve=None): """ Generates a public/private key pair :param algorithm: The key algorithm - "rsa", "dsa" or "ec" :param bit_size: An integer - used for "rsa" and "dsa". For "rsa" the value maye be 1024, 2048, 3072 or 4096. For "dsa" th...
def generate_pair(algorithm, bit_size=None, curve=None): """ Generates a public/private key pair :param algorithm: The key algorithm - "rsa", "dsa" or "ec" :param bit_size: An integer - used for "rsa" and "dsa". For "rsa" the value maye be 1024, 2048, 3072 or 4096. For "dsa" th...
[ "Generates", "a", "public", "/", "private", "key", "pair" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L547-L624
[ "def", "generate_pair", "(", "algorithm", ",", "bit_size", "=", "None", ",", "curve", "=", "None", ")", ":", "if", "algorithm", "not", "in", "set", "(", "[", "'rsa'", ",", "'dsa'", ",", "'ec'", "]", ")", ":", "raise", "ValueError", "(", "pretty_message...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_advapi32_generate_pair
Generates a public/private key pair using CryptoAPI :param algorithm: The key algorithm - "rsa" or "dsa" :param bit_size: An integer - used for "rsa" and "dsa". For "rsa" the value maye be 1024, 2048, 3072 or 4096. For "dsa" the value may be 1024. :raises: ValueError - whe...
oscrypto/_win/asymmetric.py
def _advapi32_generate_pair(algorithm, bit_size=None): """ Generates a public/private key pair using CryptoAPI :param algorithm: The key algorithm - "rsa" or "dsa" :param bit_size: An integer - used for "rsa" and "dsa". For "rsa" the value maye be 1024, 2048, 3072 or 4096. For ...
def _advapi32_generate_pair(algorithm, bit_size=None): """ Generates a public/private key pair using CryptoAPI :param algorithm: The key algorithm - "rsa" or "dsa" :param bit_size: An integer - used for "rsa" and "dsa". For "rsa" the value maye be 1024, 2048, 3072 or 4096. For ...
[ "Generates", "a", "public", "/", "private", "key", "pair", "using", "CryptoAPI" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L627-L738
[ "def", "_advapi32_generate_pair", "(", "algorithm", ",", "bit_size", "=", "None", ")", ":", "if", "algorithm", "==", "'rsa'", ":", "provider", "=", "Advapi32Const", ".", "MS_ENH_RSA_AES_PROV", "algorithm_id", "=", "Advapi32Const", ".", "CALG_RSA_SIGN", "struct_type"...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_bcrypt_generate_pair
Generates a public/private key pair using CNG :param algorithm: The key algorithm - "rsa", "dsa" or "ec" :param bit_size: An integer - used for "rsa" and "dsa". For "rsa" the value maye be 1024, 2048, 3072 or 4096. For "dsa" the value may be 1024, plus 2048 or 3072 if on Window...
oscrypto/_win/asymmetric.py
def _bcrypt_generate_pair(algorithm, bit_size=None, curve=None): """ Generates a public/private key pair using CNG :param algorithm: The key algorithm - "rsa", "dsa" or "ec" :param bit_size: An integer - used for "rsa" and "dsa". For "rsa" the value maye be 1024, 2048, 3072 or ...
def _bcrypt_generate_pair(algorithm, bit_size=None, curve=None): """ Generates a public/private key pair using CNG :param algorithm: The key algorithm - "rsa", "dsa" or "ec" :param bit_size: An integer - used for "rsa" and "dsa". For "rsa" the value maye be 1024, 2048, 3072 or ...
[ "Generates", "a", "public", "/", "private", "key", "pair", "using", "CNG" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L741-L868
[ "def", "_bcrypt_generate_pair", "(", "algorithm", ",", "bit_size", "=", "None", ",", "curve", "=", "None", ")", ":", "if", "algorithm", "==", "'rsa'", ":", "alg_constant", "=", "BcryptConst", ".", "BCRYPT_RSA_ALGORITHM", "struct_type", "=", "'BCRYPT_RSAKEY_BLOB'",...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
generate_dh_parameters
Generates DH parameters for use with Diffie-Hellman key exchange. Returns a structure in the format of DHParameter defined in PKCS#3, which is also used by the OpenSSL dhparam tool. THIS CAN BE VERY TIME CONSUMING! :param bit_size: The integer bit size of the parameters to generate. Must be be...
oscrypto/_win/asymmetric.py
def generate_dh_parameters(bit_size): """ Generates DH parameters for use with Diffie-Hellman key exchange. Returns a structure in the format of DHParameter defined in PKCS#3, which is also used by the OpenSSL dhparam tool. THIS CAN BE VERY TIME CONSUMING! :param bit_size: The integer ...
def generate_dh_parameters(bit_size): """ Generates DH parameters for use with Diffie-Hellman key exchange. Returns a structure in the format of DHParameter defined in PKCS#3, which is also used by the OpenSSL dhparam tool. THIS CAN BE VERY TIME CONSUMING! :param bit_size: The integer ...
[ "Generates", "DH", "parameters", "for", "use", "with", "Diffie", "-", "Hellman", "key", "exchange", ".", "Returns", "a", "structure", "in", "the", "format", "of", "DHParameter", "defined", "in", "PKCS#3", "which", "is", "also", "used", "by", "the", "OpenSSL"...
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L874-L971
[ "def", "generate_dh_parameters", "(", "bit_size", ")", ":", "if", "not", "isinstance", "(", "bit_size", ",", "int_types", ")", ":", "raise", "TypeError", "(", "pretty_message", "(", "'''\n bit_size must be an integer, not %s\n '''", ",", "type_name",...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_is_prime
An implementation of Miller–Rabin for checking if a number is prime. :param bit_size: An integer of the number of bits in the prime number :param n: An integer, the prime number :return: A boolean
oscrypto/_win/asymmetric.py
def _is_prime(bit_size, n): """ An implementation of Miller–Rabin for checking if a number is prime. :param bit_size: An integer of the number of bits in the prime number :param n: An integer, the prime number :return: A boolean """ r = 0 s = n - 1 while s...
def _is_prime(bit_size, n): """ An implementation of Miller–Rabin for checking if a number is prime. :param bit_size: An integer of the number of bits in the prime number :param n: An integer, the prime number :return: A boolean """ r = 0 s = n - 1 while s...
[ "An", "implementation", "of", "Miller–Rabin", "for", "checking", "if", "a", "number", "is", "prime", "." ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L977-L1020
[ "def", "_is_prime", "(", "bit_size", ",", "n", ")", ":", "r", "=", "0", "s", "=", "n", "-", "1", "while", "s", "%", "2", "==", "0", ":", "r", "+=", "1", "s", "//=", "2", "if", "bit_size", ">=", "1300", ":", "k", "=", "2", "elif", "bit_size"...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_advapi32_interpret_rsa_key_blob
Takes a CryptoAPI RSA private key blob and converts it into the ASN.1 structures for the public and private keys :param bit_size: The integer bit size of the key :param blob_struct: An instance of the advapi32.RSAPUBKEY struct :param blob: A byte string of the binary data afte...
oscrypto/_win/asymmetric.py
def _advapi32_interpret_rsa_key_blob(bit_size, blob_struct, blob): """ Takes a CryptoAPI RSA private key blob and converts it into the ASN.1 structures for the public and private keys :param bit_size: The integer bit size of the key :param blob_struct: An instance of the advapi32.R...
def _advapi32_interpret_rsa_key_blob(bit_size, blob_struct, blob): """ Takes a CryptoAPI RSA private key blob and converts it into the ASN.1 structures for the public and private keys :param bit_size: The integer bit size of the key :param blob_struct: An instance of the advapi32.R...
[ "Takes", "a", "CryptoAPI", "RSA", "private", "key", "blob", "and", "converts", "it", "into", "the", "ASN", ".", "1", "structures", "for", "the", "public", "and", "private", "keys" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L1023-L1091
[ "def", "_advapi32_interpret_rsa_key_blob", "(", "bit_size", ",", "blob_struct", ",", "blob", ")", ":", "len1", "=", "bit_size", "//", "8", "len2", "=", "bit_size", "//", "16", "prime1_offset", "=", "len1", "prime2_offset", "=", "prime1_offset", "+", "len2", "e...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_advapi32_interpret_dsa_key_blob
Takes a CryptoAPI DSS private key blob and converts it into the ASN.1 structures for the public and private keys :param bit_size: The integer bit size of the key :param public_blob: A byte string of the binary data after the public key header :param private_blob: A byte string...
oscrypto/_win/asymmetric.py
def _advapi32_interpret_dsa_key_blob(bit_size, public_blob, private_blob): """ Takes a CryptoAPI DSS private key blob and converts it into the ASN.1 structures for the public and private keys :param bit_size: The integer bit size of the key :param public_blob: A byte string of the ...
def _advapi32_interpret_dsa_key_blob(bit_size, public_blob, private_blob): """ Takes a CryptoAPI DSS private key blob and converts it into the ASN.1 structures for the public and private keys :param bit_size: The integer bit size of the key :param public_blob: A byte string of the ...
[ "Takes", "a", "CryptoAPI", "DSS", "private", "key", "blob", "and", "converts", "it", "into", "the", "ASN", ".", "1", "structures", "for", "the", "public", "and", "private", "keys" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L1094-L1152
[ "def", "_advapi32_interpret_dsa_key_blob", "(", "bit_size", ",", "public_blob", ",", "private_blob", ")", ":", "len1", "=", "20", "len2", "=", "bit_size", "//", "8", "q_offset", "=", "len2", "g_offset", "=", "q_offset", "+", "len1", "x_offset", "=", "g_offset"...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_bcrypt_interpret_rsa_key_blob
Take a CNG BCRYPT_RSAFULLPRIVATE_BLOB and converts it into an ASN.1 structure :param key_type: A unicode string of "private" or "public" :param blob_struct: An instance of BCRYPT_RSAKEY_BLOB :param blob: A byte string of the binary data contained after the struct :return:...
oscrypto/_win/asymmetric.py
def _bcrypt_interpret_rsa_key_blob(key_type, blob_struct, blob): """ Take a CNG BCRYPT_RSAFULLPRIVATE_BLOB and converts it into an ASN.1 structure :param key_type: A unicode string of "private" or "public" :param blob_struct: An instance of BCRYPT_RSAKEY_BLOB :param blob: ...
def _bcrypt_interpret_rsa_key_blob(key_type, blob_struct, blob): """ Take a CNG BCRYPT_RSAFULLPRIVATE_BLOB and converts it into an ASN.1 structure :param key_type: A unicode string of "private" or "public" :param blob_struct: An instance of BCRYPT_RSAKEY_BLOB :param blob: ...
[ "Take", "a", "CNG", "BCRYPT_RSAFULLPRIVATE_BLOB", "and", "converts", "it", "into", "an", "ASN", ".", "1", "structure" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L1155-L1237
[ "def", "_bcrypt_interpret_rsa_key_blob", "(", "key_type", ",", "blob_struct", ",", "blob", ")", ":", "public_exponent_byte_length", "=", "native", "(", "int", ",", "blob_struct", ".", "cbPublicExp", ")", "modulus_byte_length", "=", "native", "(", "int", ",", "blob...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_bcrypt_interpret_dsa_key_blob
Take a CNG BCRYPT_DSA_KEY_BLOB or BCRYPT_DSA_KEY_BLOB_V2 and converts it into an ASN.1 structure :param key_type: A unicode string of "private" or "public" :param version: An integer - 1 or 2, indicating the blob is BCRYPT_DSA_KEY_BLOB or BCRYPT_DSA_KEY_BLOB_V2 :param blob_str...
oscrypto/_win/asymmetric.py
def _bcrypt_interpret_dsa_key_blob(key_type, version, blob_struct, blob): """ Take a CNG BCRYPT_DSA_KEY_BLOB or BCRYPT_DSA_KEY_BLOB_V2 and converts it into an ASN.1 structure :param key_type: A unicode string of "private" or "public" :param version: An integer - 1 or 2, indicating ...
def _bcrypt_interpret_dsa_key_blob(key_type, version, blob_struct, blob): """ Take a CNG BCRYPT_DSA_KEY_BLOB or BCRYPT_DSA_KEY_BLOB_V2 and converts it into an ASN.1 structure :param key_type: A unicode string of "private" or "public" :param version: An integer - 1 or 2, indicating ...
[ "Take", "a", "CNG", "BCRYPT_DSA_KEY_BLOB", "or", "BCRYPT_DSA_KEY_BLOB_V2", "and", "converts", "it", "into", "an", "ASN", ".", "1", "structure" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L1240-L1328
[ "def", "_bcrypt_interpret_dsa_key_blob", "(", "key_type", ",", "version", ",", "blob_struct", ",", "blob", ")", ":", "key_byte_length", "=", "native", "(", "int", ",", "blob_struct", ".", "cbKey", ")", "if", "version", "==", "1", ":", "q", "=", "int_from_byt...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_bcrypt_interpret_ec_key_blob
Take a CNG BCRYPT_ECCKEY_BLOB and converts it into an ASN.1 structure :param key_type: A unicode string of "private" or "public" :param blob_struct: An instance of BCRYPT_ECCKEY_BLOB :param blob: A byte string of the binary data contained after the struct :return: An ...
oscrypto/_win/asymmetric.py
def _bcrypt_interpret_ec_key_blob(key_type, blob_struct, blob): """ Take a CNG BCRYPT_ECCKEY_BLOB and converts it into an ASN.1 structure :param key_type: A unicode string of "private" or "public" :param blob_struct: An instance of BCRYPT_ECCKEY_BLOB :param blob: A byte st...
def _bcrypt_interpret_ec_key_blob(key_type, blob_struct, blob): """ Take a CNG BCRYPT_ECCKEY_BLOB and converts it into an ASN.1 structure :param key_type: A unicode string of "private" or "public" :param blob_struct: An instance of BCRYPT_ECCKEY_BLOB :param blob: A byte st...
[ "Take", "a", "CNG", "BCRYPT_ECCKEY_BLOB", "and", "converts", "it", "into", "an", "ASN", ".", "1", "structure" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L1331-L1399
[ "def", "_bcrypt_interpret_ec_key_blob", "(", "key_type", ",", "blob_struct", ",", "blob", ")", ":", "magic", "=", "native", "(", "int", ",", "blob_struct", ".", "dwMagic", ")", "key_byte_length", "=", "native", "(", "int", ",", "blob_struct", ".", "cbKey", "...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_load_key
Loads a certificate, public key or private key into a Certificate, PublicKey or PrivateKey object :param key_object: An asn1crypto.x509.Certificate, asn1crypto.keys.PublicKeyInfo or asn1crypto.keys.PrivateKeyInfo object :param container: The class of the object to hold the key_hand...
oscrypto/_win/asymmetric.py
def _load_key(key_object, container): """ Loads a certificate, public key or private key into a Certificate, PublicKey or PrivateKey object :param key_object: An asn1crypto.x509.Certificate, asn1crypto.keys.PublicKeyInfo or asn1crypto.keys.PrivateKeyInfo object :param container: ...
def _load_key(key_object, container): """ Loads a certificate, public key or private key into a Certificate, PublicKey or PrivateKey object :param key_object: An asn1crypto.x509.Certificate, asn1crypto.keys.PublicKeyInfo or asn1crypto.keys.PrivateKeyInfo object :param container: ...
[ "Loads", "a", "certificate", "public", "key", "or", "private", "key", "into", "a", "Certificate", "PublicKey", "or", "PrivateKey", "object" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L1440-L1517
[ "def", "_load_key", "(", "key_object", ",", "container", ")", ":", "key_info", "=", "key_object", "if", "isinstance", "(", "key_object", ",", "x509", ".", "Certificate", ")", ":", "key_info", "=", "key_object", "[", "'tbs_certificate'", "]", "[", "'subject_pub...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_advapi32_load_key
Loads a certificate, public key or private key into a Certificate, PublicKey or PrivateKey object via CryptoAPI :param key_object: An asn1crypto.x509.Certificate, asn1crypto.keys.PublicKeyInfo or asn1crypto.keys.PrivateKeyInfo object :param key_info: An asn1crypto.keys.PublicKeyInf...
oscrypto/_win/asymmetric.py
def _advapi32_load_key(key_object, key_info, container): """ Loads a certificate, public key or private key into a Certificate, PublicKey or PrivateKey object via CryptoAPI :param key_object: An asn1crypto.x509.Certificate, asn1crypto.keys.PublicKeyInfo or asn1crypto.keys.PrivateKeyInfo...
def _advapi32_load_key(key_object, key_info, container): """ Loads a certificate, public key or private key into a Certificate, PublicKey or PrivateKey object via CryptoAPI :param key_object: An asn1crypto.x509.Certificate, asn1crypto.keys.PublicKeyInfo or asn1crypto.keys.PrivateKeyInfo...
[ "Loads", "a", "certificate", "public", "key", "or", "private", "key", "into", "a", "Certificate", "PublicKey", "or", "PrivateKey", "object", "via", "CryptoAPI" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L1520-L1602
[ "def", "_advapi32_load_key", "(", "key_object", ",", "key_info", ",", "container", ")", ":", "key_type", "=", "'public'", "if", "isinstance", "(", "key_info", ",", "keys", ".", "PublicKeyInfo", ")", "else", "'private'", "algo", "=", "key_info", ".", "algorithm...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_advapi32_create_blob
Generates a blob for importing a key to CryptoAPI :param key_info: An asn1crypto.keys.PublicKeyInfo or asn1crypto.keys.PrivateKeyInfo object :param key_type: A unicode string of "public" or "private" :param algo: A unicode string of "rsa" or "dsa" :param signing: ...
oscrypto/_win/asymmetric.py
def _advapi32_create_blob(key_info, key_type, algo, signing=True): """ Generates a blob for importing a key to CryptoAPI :param key_info: An asn1crypto.keys.PublicKeyInfo or asn1crypto.keys.PrivateKeyInfo object :param key_type: A unicode string of "public" or "private" :p...
def _advapi32_create_blob(key_info, key_type, algo, signing=True): """ Generates a blob for importing a key to CryptoAPI :param key_info: An asn1crypto.keys.PublicKeyInfo or asn1crypto.keys.PrivateKeyInfo object :param key_type: A unicode string of "public" or "private" :p...
[ "Generates", "a", "blob", "for", "importing", "a", "key", "to", "CryptoAPI" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L1605-L1705
[ "def", "_advapi32_create_blob", "(", "key_info", ",", "key_type", ",", "algo", ",", "signing", "=", "True", ")", ":", "if", "key_type", "==", "'public'", ":", "blob_type", "=", "Advapi32Const", ".", "PUBLICKEYBLOB", "else", ":", "blob_type", "=", "Advapi32Cons...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_bcrypt_load_key
Loads a certificate, public key or private key into a Certificate, PublicKey or PrivateKey object via CNG :param key_object: An asn1crypto.x509.Certificate, asn1crypto.keys.PublicKeyInfo or asn1crypto.keys.PrivateKeyInfo object :param key_info: An asn1crypto.keys.PublicKeyInfo or a...
oscrypto/_win/asymmetric.py
def _bcrypt_load_key(key_object, key_info, container, curve_name): """ Loads a certificate, public key or private key into a Certificate, PublicKey or PrivateKey object via CNG :param key_object: An asn1crypto.x509.Certificate, asn1crypto.keys.PublicKeyInfo or asn1crypto.keys.PrivateKey...
def _bcrypt_load_key(key_object, key_info, container, curve_name): """ Loads a certificate, public key or private key into a Certificate, PublicKey or PrivateKey object via CNG :param key_object: An asn1crypto.x509.Certificate, asn1crypto.keys.PublicKeyInfo or asn1crypto.keys.PrivateKey...
[ "Loads", "a", "certificate", "public", "key", "or", "private", "key", "into", "a", "Certificate", "PublicKey", "or", "PrivateKey", "object", "via", "CNG" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L1708-L1927
[ "def", "_bcrypt_load_key", "(", "key_object", ",", "key_info", ",", "container", ",", "curve_name", ")", ":", "alg_handle", "=", "None", "key_handle", "=", "None", "key_type", "=", "'public'", "if", "isinstance", "(", "key_info", ",", "keys", ".", "PublicKeyIn...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
load_public_key
Loads a public key into a PublicKey object :param source: A byte string of file contents, a unicode string filename or an asn1crypto.keys.PublicKeyInfo object :raises: ValueError - when any of the parameters contain an invalid value TypeError - when any of the parameters are of...
oscrypto/_win/asymmetric.py
def load_public_key(source): """ Loads a public key into a PublicKey object :param source: A byte string of file contents, a unicode string filename or an asn1crypto.keys.PublicKeyInfo object :raises: ValueError - when any of the parameters contain an invalid value Type...
def load_public_key(source): """ Loads a public key into a PublicKey object :param source: A byte string of file contents, a unicode string filename or an asn1crypto.keys.PublicKeyInfo object :raises: ValueError - when any of the parameters contain an invalid value Type...
[ "Loads", "a", "public", "key", "into", "a", "PublicKey", "object" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L1986-L2023
[ "def", "load_public_key", "(", "source", ")", ":", "if", "isinstance", "(", "source", ",", "keys", ".", "PublicKeyInfo", ")", ":", "public_key", "=", "source", "elif", "isinstance", "(", "source", ",", "byte_cls", ")", ":", "public_key", "=", "parse_public",...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
load_pkcs12
Loads a .p12 or .pfx file into a PrivateKey object and one or more Certificates objects :param source: A byte string of file contents or a unicode string filename :param password: A byte or unicode string to decrypt the PKCS12 file. Unicode strings will be encoded using UTF-8. ...
oscrypto/_win/asymmetric.py
def load_pkcs12(source, password=None): """ Loads a .p12 or .pfx file into a PrivateKey object and one or more Certificates objects :param source: A byte string of file contents or a unicode string filename :param password: A byte or unicode string to decrypt the PKCS12 file. Unico...
def load_pkcs12(source, password=None): """ Loads a .p12 or .pfx file into a PrivateKey object and one or more Certificates objects :param source: A byte string of file contents or a unicode string filename :param password: A byte or unicode string to decrypt the PKCS12 file. Unico...
[ "Loads", "a", ".", "p12", "or", ".", "pfx", "file", "into", "a", "PrivateKey", "object", "and", "one", "or", "more", "Certificates", "objects" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L2026-L2084
[ "def", "load_pkcs12", "(", "source", ",", "password", "=", "None", ")", ":", "if", "password", "is", "not", "None", ":", "if", "isinstance", "(", "password", ",", "str_cls", ")", ":", "password", "=", "password", ".", "encode", "(", "'utf-8'", ")", "if...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
rsa_pkcs1v15_verify
Verifies an RSASSA-PKCS-v1.5 signature. When the hash_algorithm is "raw", the operation is identical to RSA public key decryption. That is: the data is not hashed and no ASN.1 structure with an algorithm identifier of the hash algorithm is placed in the encrypted byte string. :param certificate_or...
oscrypto/_win/asymmetric.py
def rsa_pkcs1v15_verify(certificate_or_public_key, signature, data, hash_algorithm): """ Verifies an RSASSA-PKCS-v1.5 signature. When the hash_algorithm is "raw", the operation is identical to RSA public key decryption. That is: the data is not hashed and no ASN.1 structure with an algorithm identi...
def rsa_pkcs1v15_verify(certificate_or_public_key, signature, data, hash_algorithm): """ Verifies an RSASSA-PKCS-v1.5 signature. When the hash_algorithm is "raw", the operation is identical to RSA public key decryption. That is: the data is not hashed and no ASN.1 structure with an algorithm identi...
[ "Verifies", "an", "RSASSA", "-", "PKCS", "-", "v1", ".", "5", "signature", "." ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L2087-L2118
[ "def", "rsa_pkcs1v15_verify", "(", "certificate_or_public_key", ",", "signature", ",", "data", ",", "hash_algorithm", ")", ":", "if", "certificate_or_public_key", ".", "algorithm", "!=", "'rsa'", ":", "raise", "ValueError", "(", "'The key specified is not an RSA public ke...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
rsa_pss_verify
Verifies an RSASSA-PSS signature. For the PSS padding the mask gen algorithm will be mgf1 using the same hash algorithm as the signature. The salt length with be the length of the hash algorithm, and the trailer field with be the standard 0xBC byte. :param certificate_or_public_key: A Certifica...
oscrypto/_win/asymmetric.py
def rsa_pss_verify(certificate_or_public_key, signature, data, hash_algorithm): """ Verifies an RSASSA-PSS signature. For the PSS padding the mask gen algorithm will be mgf1 using the same hash algorithm as the signature. The salt length with be the length of the hash algorithm, and the trailer field wi...
def rsa_pss_verify(certificate_or_public_key, signature, data, hash_algorithm): """ Verifies an RSASSA-PSS signature. For the PSS padding the mask gen algorithm will be mgf1 using the same hash algorithm as the signature. The salt length with be the length of the hash algorithm, and the trailer field wi...
[ "Verifies", "an", "RSASSA", "-", "PSS", "signature", ".", "For", "the", "PSS", "padding", "the", "mask", "gen", "algorithm", "will", "be", "mgf1", "using", "the", "same", "hash", "algorithm", "as", "the", "signature", ".", "The", "salt", "length", "with", ...
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L2121-L2150
[ "def", "rsa_pss_verify", "(", "certificate_or_public_key", ",", "signature", ",", "data", ",", "hash_algorithm", ")", ":", "if", "certificate_or_public_key", ".", "algorithm", "!=", "'rsa'", ":", "raise", "ValueError", "(", "'The key specified is not an RSA public key'", ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_verify
Verifies an RSA, DSA or ECDSA signature :param certificate_or_public_key: A Certificate or PublicKey instance to verify the signature with :param signature: A byte string of the signature to verify :param data: A byte string of the data the signature is for :param hash_algori...
oscrypto/_win/asymmetric.py
def _verify(certificate_or_public_key, signature, data, hash_algorithm, rsa_pss_padding=False): """ Verifies an RSA, DSA or ECDSA signature :param certificate_or_public_key: A Certificate or PublicKey instance to verify the signature with :param signature: A byte string of the signatur...
def _verify(certificate_or_public_key, signature, data, hash_algorithm, rsa_pss_padding=False): """ Verifies an RSA, DSA or ECDSA signature :param certificate_or_public_key: A Certificate or PublicKey instance to verify the signature with :param signature: A byte string of the signatur...
[ "Verifies", "an", "RSA", "DSA", "or", "ECDSA", "signature" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L2211-L2303
[ "def", "_verify", "(", "certificate_or_public_key", ",", "signature", ",", "data", ",", "hash_algorithm", ",", "rsa_pss_padding", "=", "False", ")", ":", "if", "not", "isinstance", "(", "certificate_or_public_key", ",", "(", "Certificate", ",", "PublicKey", ")", ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_advapi32_verify
Verifies an RSA, DSA or ECDSA signature via CryptoAPI :param certificate_or_public_key: A Certificate or PublicKey instance to verify the signature with :param signature: A byte string of the signature to verify :param data: A byte string of the data the signature is for :par...
oscrypto/_win/asymmetric.py
def _advapi32_verify(certificate_or_public_key, signature, data, hash_algorithm, rsa_pss_padding=False): """ Verifies an RSA, DSA or ECDSA signature via CryptoAPI :param certificate_or_public_key: A Certificate or PublicKey instance to verify the signature with :param signature: A byte...
def _advapi32_verify(certificate_or_public_key, signature, data, hash_algorithm, rsa_pss_padding=False): """ Verifies an RSA, DSA or ECDSA signature via CryptoAPI :param certificate_or_public_key: A Certificate or PublicKey instance to verify the signature with :param signature: A byte...
[ "Verifies", "an", "RSA", "DSA", "or", "ECDSA", "signature", "via", "CryptoAPI" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L2306-L2412
[ "def", "_advapi32_verify", "(", "certificate_or_public_key", ",", "signature", ",", "data", ",", "hash_algorithm", ",", "rsa_pss_padding", "=", "False", ")", ":", "algo", "=", "certificate_or_public_key", ".", "algorithm", "if", "algo", "==", "'rsa'", "and", "rsa_...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_bcrypt_verify
Verifies an RSA, DSA or ECDSA signature via CNG :param certificate_or_public_key: A Certificate or PublicKey instance to verify the signature with :param signature: A byte string of the signature to verify :param data: A byte string of the data the signature is for :param has...
oscrypto/_win/asymmetric.py
def _bcrypt_verify(certificate_or_public_key, signature, data, hash_algorithm, rsa_pss_padding=False): """ Verifies an RSA, DSA or ECDSA signature via CNG :param certificate_or_public_key: A Certificate or PublicKey instance to verify the signature with :param signature: A byte string ...
def _bcrypt_verify(certificate_or_public_key, signature, data, hash_algorithm, rsa_pss_padding=False): """ Verifies an RSA, DSA or ECDSA signature via CNG :param certificate_or_public_key: A Certificate or PublicKey instance to verify the signature with :param signature: A byte string ...
[ "Verifies", "an", "RSA", "DSA", "or", "ECDSA", "signature", "via", "CNG" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L2415-L2498
[ "def", "_bcrypt_verify", "(", "certificate_or_public_key", ",", "signature", ",", "data", ",", "hash_algorithm", ",", "rsa_pss_padding", "=", "False", ")", ":", "if", "hash_algorithm", "==", "'raw'", ":", "digest", "=", "data", "else", ":", "hash_constant", "=",...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
rsa_pkcs1v15_sign
Generates an RSASSA-PKCS-v1.5 signature. When the hash_algorithm is "raw", the operation is identical to RSA private key encryption. That is: the data is not hashed and no ASN.1 structure with an algorithm identifier of the hash algorithm is placed in the encrypted byte string. :param private_key:...
oscrypto/_win/asymmetric.py
def rsa_pkcs1v15_sign(private_key, data, hash_algorithm): """ Generates an RSASSA-PKCS-v1.5 signature. When the hash_algorithm is "raw", the operation is identical to RSA private key encryption. That is: the data is not hashed and no ASN.1 structure with an algorithm identifier of the hash algorith...
def rsa_pkcs1v15_sign(private_key, data, hash_algorithm): """ Generates an RSASSA-PKCS-v1.5 signature. When the hash_algorithm is "raw", the operation is identical to RSA private key encryption. That is: the data is not hashed and no ASN.1 structure with an algorithm identifier of the hash algorith...
[ "Generates", "an", "RSASSA", "-", "PKCS", "-", "v1", ".", "5", "signature", "." ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L2501-L2531
[ "def", "rsa_pkcs1v15_sign", "(", "private_key", ",", "data", ",", "hash_algorithm", ")", ":", "if", "private_key", ".", "algorithm", "!=", "'rsa'", ":", "raise", "ValueError", "(", "'The key specified is not an RSA private key'", ")", "return", "_sign", "(", "privat...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
rsa_pss_sign
Generates an RSASSA-PSS signature. For the PSS padding the mask gen algorithm will be mgf1 using the same hash algorithm as the signature. The salt length with be the length of the hash algorithm, and the trailer field with be the standard 0xBC byte. :param private_key: The PrivateKey to genera...
oscrypto/_win/asymmetric.py
def rsa_pss_sign(private_key, data, hash_algorithm): """ Generates an RSASSA-PSS signature. For the PSS padding the mask gen algorithm will be mgf1 using the same hash algorithm as the signature. The salt length with be the length of the hash algorithm, and the trailer field with be the standard 0xB...
def rsa_pss_sign(private_key, data, hash_algorithm): """ Generates an RSASSA-PSS signature. For the PSS padding the mask gen algorithm will be mgf1 using the same hash algorithm as the signature. The salt length with be the length of the hash algorithm, and the trailer field with be the standard 0xB...
[ "Generates", "an", "RSASSA", "-", "PSS", "signature", ".", "For", "the", "PSS", "padding", "the", "mask", "gen", "algorithm", "will", "be", "mgf1", "using", "the", "same", "hash", "algorithm", "as", "the", "signature", ".", "The", "salt", "length", "with",...
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L2534-L2562
[ "def", "rsa_pss_sign", "(", "private_key", ",", "data", ",", "hash_algorithm", ")", ":", "if", "private_key", ".", "algorithm", "!=", "'rsa'", ":", "raise", "ValueError", "(", "'The key specified is not an RSA private key'", ")", "return", "_sign", "(", "private_key...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
dsa_sign
Generates a DSA signature :param private_key: The PrivateKey to generate the signature with :param data: A byte string of the data the signature is for :param hash_algorithm: A unicode string of "md5", "sha1", "sha256", "sha384" or "sha512" :raises: ValueError - when ...
oscrypto/_win/asymmetric.py
def dsa_sign(private_key, data, hash_algorithm): """ Generates a DSA signature :param private_key: The PrivateKey to generate the signature with :param data: A byte string of the data the signature is for :param hash_algorithm: A unicode string of "md5", "sha1", "sha256", ...
def dsa_sign(private_key, data, hash_algorithm): """ Generates a DSA signature :param private_key: The PrivateKey to generate the signature with :param data: A byte string of the data the signature is for :param hash_algorithm: A unicode string of "md5", "sha1", "sha256", ...
[ "Generates", "a", "DSA", "signature" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L2565-L2590
[ "def", "dsa_sign", "(", "private_key", ",", "data", ",", "hash_algorithm", ")", ":", "if", "private_key", ".", "algorithm", "!=", "'dsa'", ":", "raise", "ValueError", "(", "'The key specified is not a DSA private key'", ")", "return", "_sign", "(", "private_key", ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
ecdsa_sign
Generates an ECDSA signature :param private_key: The PrivateKey to generate the signature with :param data: A byte string of the data the signature is for :param hash_algorithm: A unicode string of "md5", "sha1", "sha256", "sha384" or "sha512" :raises: ValueError - wh...
oscrypto/_win/asymmetric.py
def ecdsa_sign(private_key, data, hash_algorithm): """ Generates an ECDSA signature :param private_key: The PrivateKey to generate the signature with :param data: A byte string of the data the signature is for :param hash_algorithm: A unicode string of "md5", "sha1", "sha2...
def ecdsa_sign(private_key, data, hash_algorithm): """ Generates an ECDSA signature :param private_key: The PrivateKey to generate the signature with :param data: A byte string of the data the signature is for :param hash_algorithm: A unicode string of "md5", "sha1", "sha2...
[ "Generates", "an", "ECDSA", "signature" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L2593-L2618
[ "def", "ecdsa_sign", "(", "private_key", ",", "data", ",", "hash_algorithm", ")", ":", "if", "private_key", ".", "algorithm", "!=", "'ec'", ":", "raise", "ValueError", "(", "'The key specified is not an EC private key'", ")", "return", "_sign", "(", "private_key", ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_sign
Generates an RSA, DSA or ECDSA signature :param private_key: The PrivateKey to generate the signature with :param data: A byte string of the data the signature is for :param hash_algorithm: A unicode string of "md5", "sha1", "sha256", "sha384", "sha512" or "raw" :param rsa_ps...
oscrypto/_win/asymmetric.py
def _sign(private_key, data, hash_algorithm, rsa_pss_padding=False): """ Generates an RSA, DSA or ECDSA signature :param private_key: The PrivateKey to generate the signature with :param data: A byte string of the data the signature is for :param hash_algorithm: A unicode ...
def _sign(private_key, data, hash_algorithm, rsa_pss_padding=False): """ Generates an RSA, DSA or ECDSA signature :param private_key: The PrivateKey to generate the signature with :param data: A byte string of the data the signature is for :param hash_algorithm: A unicode ...
[ "Generates", "an", "RSA", "DSA", "or", "ECDSA", "signature" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L2621-L2703
[ "def", "_sign", "(", "private_key", ",", "data", ",", "hash_algorithm", ",", "rsa_pss_padding", "=", "False", ")", ":", "if", "not", "isinstance", "(", "private_key", ",", "PrivateKey", ")", ":", "raise", "TypeError", "(", "pretty_message", "(", "'''\n ...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c
valid
_advapi32_sign
Generates an RSA, DSA or ECDSA signature via CryptoAPI :param private_key: The PrivateKey to generate the signature with :param data: A byte string of the data the signature is for :param hash_algorithm: A unicode string of "md5", "sha1", "sha256", "sha384", "sha512" or "raw" ...
oscrypto/_win/asymmetric.py
def _advapi32_sign(private_key, data, hash_algorithm, rsa_pss_padding=False): """ Generates an RSA, DSA or ECDSA signature via CryptoAPI :param private_key: The PrivateKey to generate the signature with :param data: A byte string of the data the signature is for :param hash_algori...
def _advapi32_sign(private_key, data, hash_algorithm, rsa_pss_padding=False): """ Generates an RSA, DSA or ECDSA signature via CryptoAPI :param private_key: The PrivateKey to generate the signature with :param data: A byte string of the data the signature is for :param hash_algori...
[ "Generates", "an", "RSA", "DSA", "or", "ECDSA", "signature", "via", "CryptoAPI" ]
wbond/oscrypto
python
https://github.com/wbond/oscrypto/blob/af778bf1c88bf6c4a7342f5353b130686a5bbe1c/oscrypto/_win/asymmetric.py#L2706-L2824
[ "def", "_advapi32_sign", "(", "private_key", ",", "data", ",", "hash_algorithm", ",", "rsa_pss_padding", "=", "False", ")", ":", "algo", "=", "private_key", ".", "algorithm", "if", "algo", "==", "'rsa'", "and", "hash_algorithm", "==", "'raw'", ":", "padded_dat...
af778bf1c88bf6c4a7342f5353b130686a5bbe1c