pymensago/keycard.py
def chain(self, key: CryptoString, rotate_optional: bool) -> RetVal:
		'''Creates a new UserEntry object with new keys and a custody signature. It requires the 
		previous contact request signing key passed as an CryptoString. The new keys are returned in 
		CryptoString format using the following fields:
		entry
		crsign.public / crsign.private -- contact request signing keypair
		crencrypt.public / crencrypt.private -- contact request encryption keypair
		encrypt.public / encrypt.private -- general-purpose public encryption keypair
		sign.public / sign.private -- general-purpose primary signing keypair

		Full SigningPair / EncryptionPair objects can be found in
		crsign
		crencrypt
		sign
		encrypt
		'''

		if key.prefix != 'ED25519':
			return RetVal(ErrBadValue, f'wrong key type {key.prefix}')
		
		status = self.is_compliant()
		if status.error():
			return status
		
		new_entry = UserEntry()
		new_entry.fields = self.fields.copy()
		try:
			index = int(new_entry.fields['Index'])
			new_entry.fields['Index'] = str(index + 1)
		except Exception:
			return RetVal(ErrBadData, 'invalid entry index')

		out = RetVal()

		crskey = SigningPair()
		crekey = EncryptionPair()
		ekey = EncryptionPair()
		skey = SigningPair()

		out['crsign'] = crskey
		out['crsign.public'] = crskey.get_public_key()
		out['crsign.private'] = crskey.get_private_key()
		out['crencrypt'] = crekey
		out['crencrypt.public'] = crekey.get_public_key()
		out['crencrypt.private'] = crekey.get_private_key()
		out['encrypt'] = ekey
		out['encrypt.public'] = ekey.get_public_key()
		out['encrypt.private'] = ekey.get_private_key()
		out['sign'] = skey
		out['sign.public'] = skey.get_public_key()
		out['sign.private'] = skey.get_private_key()
		
		new_entry.fields['Contact-Request-Verification-Key'] = out['crsign.public']
		new_entry.fields['Contact-Request-Encryption-Key'] = out['crencrypt.public']
		new_entry.fields['Encryption-Key'] = out['encrypt.public']
		new_entry.fields['Verification-Key'] = out['sign.public']

		status = new_entry.sign(key, 'Custody')
		if status.error():
			return status

		out['entry'] = new_entry
		return out
Creates a new UserEntry object with new keys and a custody signature. It requires the 
		previous contact request signing key passed as an CryptoString. The new keys are returned in 
		CryptoString format using the following fields:
		entry
		crsign.public / crsign.private -- contact request signing keypair
		crencrypt.public / crencrypt.private -- contact request encryption keypair
		encrypt.public / encrypt.private -- general-purpose public encryption keypair
		sign.public / sign.private -- general-purpose primary signing keypair

		Full SigningPair / EncryptionPair objects can be found in
		crsign
		crencrypt
		sign
		encrypt
		
Creates a new UserEntry object with new keys and a custody signature. It requires the
previous contact request signing key passed as an CryptoString.

Full SigningPair / EncryptionPair objects can be found in
crsign
crencrypt
sign
encrypt
Creates a new UserEntry object with new keys and a custody signature . It requires the previous contact request signing key passed as an CryptoString . Full SigningPair / EncryptionPair objects can be found in crsign crencrypt sign encrypt
def chain(self, key: CryptoString, rotate_optional: bool) -> RetVal:
		if key.prefix != 'ED25519':
			return RetVal(ErrBadValue, f'wrong key type {key.prefix}')
		status = self.is_compliant()
		if status.error():
			return status
		new_entry = UserEntry()
		new_entry.fields = self.fields.copy()
		try:
			index = int(new_entry.fields['Index'])
			new_entry.fields['Index'] = str(index + 1)
		except Exception:
			return RetVal(ErrBadData, 'invalid entry index')
		out = RetVal()
		crskey = SigningPair()
		crekey = EncryptionPair()
		ekey = EncryptionPair()
		skey = SigningPair()
		out['crsign'] = crskey
		out['crsign.public'] = crskey.get_public_key()
		out['crsign.private'] = crskey.get_private_key()
		out['crencrypt'] = crekey
		out['crencrypt.public'] = crekey.get_public_key()
		out['crencrypt.private'] = crekey.get_private_key()
		out['encrypt'] = ekey
		out['encrypt.public'] = ekey.get_public_key()
		out['encrypt.private'] = ekey.get_private_key()
		out['sign'] = skey
		out['sign.public'] = skey.get_public_key()
		out['sign.private'] = skey.get_private_key()
		new_entry.fields['Contact-Request-Verification-Key'] = out['crsign.public']
		new_entry.fields['Contact-Request-Encryption-Key'] = out['crencrypt.public']
		new_entry.fields['Encryption-Key'] = out['encrypt.public']
		new_entry.fields['Verification-Key'] = out['sign.public']
		status = new_entry.sign(key, 'Custody')
		if status.error():
			return status
		out['entry'] = new_entry
		return out
def chain ( self , key : CryptoString , rotate_optional : bool ) -> RetVal : if key . prefix != 'ED25519' : return RetVal ( ErrBadValue , f'wrong key type {key.prefix}' ) status = self . is_compliant ( ) if status . error ( ) : return status new_entry = UserEntry ( ) new_entry . fields = self . fields . copy ( ) try : index = int ( new_entry . fields [ 'Index' ] ) new_entry . fields [ 'Index' ] = str ( index + 1 ) except Exception : return RetVal ( ErrBadData , 'invalid entry index' ) out = RetVal ( ) crskey = SigningPair ( ) crekey = EncryptionPair ( ) ekey = EncryptionPair ( ) skey = SigningPair ( ) out [ 'crsign' ] = crskey out [ 'crsign.public' ] = crskey . get_public_key ( ) out [ 'crsign.private' ] = crskey . get_private_key ( ) out [ 'crencrypt' ] = crekey out [ 'crencrypt.public' ] = crekey . get_public_key ( ) out [ 'crencrypt.private' ] = crekey . get_private_key ( ) out [ 'encrypt' ] = ekey out [ 'encrypt.public' ] = ekey . get_public_key ( ) out [ 'encrypt.private' ] = ekey . get_private_key ( ) out [ 'sign' ] = skey out [ 'sign.public' ] = skey . get_public_key ( ) out [ 'sign.private' ] = skey . get_private_key ( ) new_entry . fields [ 'Contact-Request-Verification-Key' ] = out [ 'crsign.public' ] new_entry . fields [ 'Contact-Request-Encryption-Key' ] = out [ 'crencrypt.public' ] new_entry . fields [ 'Encryption-Key' ] = out [ 'encrypt.public' ] new_entry . fields [ 'Verification-Key' ] = out [ 'sign.public' ] status = new_entry . sign ( key , 'Custody' ) if status . error ( ) : return status out [ 'entry' ] = new_entry return out
Creates a new UserEntry object with new keys and a custody signature.
Creates a new UserEntry object with new keys and a custody signature .
'''Creates a new UserEntry object with new keys and a custody signature. It requires the 
		previous contact request signing key passed as an CryptoString. The new keys are returned in 
		CryptoString format using the following fields:
		entry
		crsign.public / crsign.private -- contact request signing keypair
		crencrypt.public / crencrypt.private -- contact request encryption keypair
		encrypt.public / encrypt.private -- general-purpose public encryption keypair
		sign.public / sign.private -- general-purpose primary signing keypair

		Full SigningPair / EncryptionPair objects can be found in
		crsign
		crencrypt
		sign
		encrypt
		'''
self
key
CryptoString
rotate_optional
bool