pymensago/keycard.py
def chain(self, key: CryptoString, rotate_optional: bool) -> RetVal:
		'''Appends a new entry to the chain. This method requires that the root entry already 
		exist. Note that user cards will not have all the required signatures when the call returns'''
		if len(self.entries) < 1:
			return RetVal(ErrNotFound, 'missing root entry')

		# Just in case we get some squirrelly non-Org, non-User card type
		chain_method = getattr(self.entries[-1], "chain", None)
		if not chain_method or not callable(chain_method):
			return RetVal(FeatureNotAvailable, "entry doesn't support chaining")
		
		chaindata = self.entries[-1].chain(key, rotate_optional)
		if chaindata.error():
			return chaindata
		
		new_entry = chaindata['entry']

		skeystring = CryptoString()
		if not skeystring.set(chaindata['sign.private']):
			return RetVal(ErrBadData, 'bad signing key')
		
		if new_entry.type == 'User':
			status = new_entry.sign(skeystring, 'User')
		else:
			status = new_entry.sign(skeystring, 'Organization')
		if status.error():
			return status
		
		chaindata['entry'] = new_entry
		self.entries.append(new_entry)
		return chaindata
Appends a new entry to the chain. This method requires that the root entry already 
		exist. Note that user cards will not have all the required signatures when the call returns
Appends a new entry to the chain. This method requires that the root entry already
exist. Note that user cards will not have all the required signatures when the call returns
Appends a new entry to the chain . This method requires that the root entry already exist . Note that user cards will not have all the required signatures when the call returns
def chain(self, key: CryptoString, rotate_optional: bool) -> RetVal:
		if len(self.entries) < 1:
			return RetVal(ErrNotFound, 'missing root entry')
		chain_method = getattr(self.entries[-1], "chain", None)
		if not chain_method or not callable(chain_method):
			return RetVal(FeatureNotAvailable, "entry doesn't support chaining")
		chaindata = self.entries[-1].chain(key, rotate_optional)
		if chaindata.error():
			return chaindata
		new_entry = chaindata['entry']
		skeystring = CryptoString()
		if not skeystring.set(chaindata['sign.private']):
			return RetVal(ErrBadData, 'bad signing key')
		if new_entry.type == 'User':
			status = new_entry.sign(skeystring, 'User')
		else:
			status = new_entry.sign(skeystring, 'Organization')
		if status.error():
			return status
		chaindata['entry'] = new_entry
		self.entries.append(new_entry)
		return chaindata
def chain ( self , key : CryptoString , rotate_optional : bool ) -> RetVal : if len ( self . entries ) < 1 : return RetVal ( ErrNotFound , 'missing root entry' ) chain_method = getattr ( self . entries [ - 1 ] , "chain" , None ) if not chain_method or not callable ( chain_method ) : return RetVal ( FeatureNotAvailable , "entry doesn't support chaining" ) chaindata = self . entries [ - 1 ] . chain ( key , rotate_optional ) if chaindata . error ( ) : return chaindata new_entry = chaindata [ 'entry' ] skeystring = CryptoString ( ) if not skeystring . set ( chaindata [ 'sign.private' ] ) : return RetVal ( ErrBadData , 'bad signing key' ) if new_entry . type == 'User' : status = new_entry . sign ( skeystring , 'User' ) else : status = new_entry . sign ( skeystring , 'Organization' ) if status . error ( ) : return status chaindata [ 'entry' ] = new_entry self . entries . append ( new_entry ) return chaindata
Appends a new entry to the chain.
Appends a new entry to the chain .
'''Appends a new entry to the chain. This method requires that the root entry already 
		exist. Note that user cards will not have all the required signatures when the call returns''' # Just in case we get some squirrelly non-Org, non-User card type
self
key
CryptoString
rotate_optional
bool