Example #1
0
  def read_no_secret(cls, keyset_reader: reader.KeysetReader) -> 'KeysetHandle':
    """Creates a KeysetHandle from a keyset with no secret key material.

    This can be used to load public keysets or envelope encryption keysets.

    Args:
      keyset_reader: A core.KeysetReader object.

    Returns:
      A new KeysetHandle.
    """
    keyset = keyset_reader.read()
    _assert_no_secret_key_material(keyset)
    return cls._create(keyset)
Example #2
0
 def read(cls,
          keyset_reader: reader.KeysetReader) -> keyset_handle.KeysetHandle:
     """Create a KeysetHandle from a keyset read with keyset_reader."""
     keyset = keyset_reader.read()
     return cls._create(keyset)