# Path: securesystemslib/exceptions.py
# class Error(Exception):
# class Warning(Warning):
# class FormatError(Error):
# class InvalidMetadataJSONError(FormatError):
# class UnsupportedAlgorithmError(Error):
# class BadHashError(Error):
# class BadPasswordError(Error):
# class CryptoError(Error):
# class BadSignatureError(CryptoError):
# class UnknownMethodError(CryptoError):
# class UnsupportedLibraryError(Error):
# class InvalidNameError(Error):
# class NotFoundError(Error):
# class URLMatchesNoPatternError(Error):
# class InvalidConfigurationError(Error):
# class StorageError(Error):
#   def __init__(self, exception):
#   def __str__(self):
#   def __init__(self, expected_hash, observed_hash):
#   def __str__(self):
#   def __init__(self, metadata_role_name):
#   def __str__(self):
# 
# Path: securesystemslib/schema.py
# class Schema:
# class Any(Schema):
# class String(Schema):
# class AnyString(Schema):
# class AnyNonemptyString(AnyString):
# class AnyBytes(Schema):
# class LengthString(Schema):
# class LengthBytes(Schema):
# class OneOf(Schema):
# class AllOf(Schema):
# class Boolean(Schema):
# class ListOf(Schema):
# class Integer(Schema):
# class DictOf(Schema):
# class Optional(Schema):
# class Object(Schema):
# class Struct(Schema):
# class RegularExpression(Schema):
#   def matches(self, object):
#   def check_match(self, object):
#   def __init__(self):
#   def check_match(self, object):
#   def __init__(self, string):
#   def check_match(self, object):
#   def __init__(self):
#   def check_match(self, object):
#   def check_match(self, object):
#   def __init__(self):
#   def check_match(self, object):
#   def __init__(self, length):
#   def check_match(self, object):
#   def __init__(self, length):
#   def check_match(self, object):
#   def __init__(self, alternatives):
#   def check_match(self, object):
#   def __init__(self, required_schemas):
#   def check_match(self, object):
#   def __init__(self):
#   def check_match(self, object):
#   def __init__(self, schema, min_count=0, max_count=sys.maxsize, list_name='list'):
#   def check_match(self, object):
#   def __init__(self, lo = -2147483648, hi = 2147483647):
#   def check_match(self, object):
#   def __init__(self, key_schema, value_schema):
#   def check_match(self, object):
#   def __init__(self, schema):
#   def check_match(self, object):
#   def __init__(self, object_name='object', **required):
#   def check_match(self, object):
#   def __init__(self, sub_schemas, optional_schemas=None, allow_more=False,
#                struct_name='list'):
#   def check_match(self, object):
#   def __init__(self, pattern=None, modifiers=0, re_object=None, re_name=None):
#   def check_match(self, object):


import binascii
import calendar
import re
import datetime
import time
from securesystemslib import exceptions
from securesystemslib import schema as SCHEMA
  securesystemslib.formats.RSAKEY_SCHEMA.check_match(rsa_key)
  securesystemslib.formats.RSAKEY_SCHEMA.matches(rsa_key)

  In this example, if a dict key or dict value is missing or incorrect,
  the match fails.  There are numerous variations of object checking
  provided by 'formats.py' and 'schema.py'.

  The second section deals with the role metadata classes.  There are
  multiple top-level roles, each with differing metadata formats.
  Example:

  root_object = securesystemslib.formats.RootFile.from_metadata(root_metadata_file)
  targets_metadata = securesystemslib.formats.TargetsFile.make_metadata(...)

  The input and output of these classes are checked against their respective
  schema to ensure correctly formatted metadata.

  The last section contains miscellaneous functions related to the format of
  securesystemslib objects.
  Example:

  signable_object = make_signable(unsigned_object)
"""



# Note that in the schema definitions below, the 'SCHEMA.Object' types allow
# additional keys which are not defined. Thus, any additions to them will be
# easily backwards compatible with clients that are already deployed.


# Path: securesystemslib/exceptions.py
# class Error(Exception):
# class Warning(Warning):
# class FormatError(Error):
# class InvalidMetadataJSONError(FormatError):
# class UnsupportedAlgorithmError(Error):
# class BadHashError(Error):
# class BadPasswordError(Error):
# class CryptoError(Error):
# class BadSignatureError(CryptoError):
# class UnknownMethodError(CryptoError):
# class UnsupportedLibraryError(Error):
# class InvalidNameError(Error):
# class NotFoundError(Error):
# class URLMatchesNoPatternError(Error):
# class InvalidConfigurationError(Error):
# class StorageError(Error):
#   def __init__(self, exception):
#   def __str__(self):
#   def __init__(self, expected_hash, observed_hash):
#   def __str__(self):
#   def __init__(self, metadata_role_name):
#   def __str__(self):
# 
# Path: securesystemslib/schema.py
# class Schema:
# class Any(Schema):
# class String(Schema):
# class AnyString(Schema):
# class AnyNonemptyString(AnyString):
# class AnyBytes(Schema):
# class LengthString(Schema):
# class LengthBytes(Schema):
# class OneOf(Schema):
# class AllOf(Schema):
# class Boolean(Schema):
# class ListOf(Schema):
# class Integer(Schema):
# class DictOf(Schema):
# class Optional(Schema):
# class Object(Schema):
# class Struct(Schema):
# class RegularExpression(Schema):
#   def matches(self, object):
#   def check_match(self, object):
#   def __init__(self):
#   def check_match(self, object):
#   def __init__(self, string):
#   def check_match(self, object):
#   def __init__(self):
#   def check_match(self, object):
#   def check_match(self, object):
#   def __init__(self):
#   def check_match(self, object):
#   def __init__(self, length):
#   def check_match(self, object):
#   def __init__(self, length):
#   def check_match(self, object):
#   def __init__(self, alternatives):
#   def check_match(self, object):
#   def __init__(self, required_schemas):
#   def check_match(self, object):
#   def __init__(self):
#   def check_match(self, object):
#   def __init__(self, schema, min_count=0, max_count=sys.maxsize, list_name='list'):
#   def check_match(self, object):
#   def __init__(self, lo = -2147483648, hi = 2147483647):
#   def check_match(self, object):
#   def __init__(self, key_schema, value_schema):
#   def check_match(self, object):
#   def __init__(self, schema):
#   def check_match(self, object):
#   def __init__(self, object_name='object', **required):
#   def check_match(self, object):
#   def __init__(self, sub_schemas, optional_schemas=None, allow_more=False,
#                struct_name='list'):
#   def check_match(self, object):
#   def __init__(self, pattern=None, modifiers=0, re_object=None, re_name=None):
#   def check_match(self, object):


# Path: securesystemslib/formats.py
import binascii
import calendar
import re
import datetime
import time
from securesystemslib import exceptions
from securesystemslib import schema as SCHEMA

  securesystemslib.formats.RSAKEY_SCHEMA.check_match(rsa_key)
  securesystemslib.formats.RSAKEY_SCHEMA.matches(rsa_key)

  In this example, if a dict key or dict value is missing or incorrect,
  the match fails.  There are numerous variations of object checking
  provided by 'formats.py' and 'schema.py'.

  The second section deals with the role metadata classes.  There are
  multiple top-level roles, each with differing metadata formats.
  Example:

  root_object = securesystemslib.formats.RootFile.from_metadata(root_metadata_file)
  targets_metadata = securesystemslib.formats.TargetsFile.make_metadata(...)

  The input and output of these classes are checked against their respective
  schema to ensure correctly formatted metadata.

  The last section contains miscellaneous functions related to the format of
  securesystemslib objects.
  Example:

  signable_object = make_signable(unsigned_object)
"""



# Note that in the schema definitions below, the 'SCHEMA.Object' types allow
# additional keys which are not defined. Thus, any additions to them will be
# easily backwards compatible with clients that are already deployed.


ANY_STRING_SCHEMA = SCHEMA.AnyString()