completed Key#import with tests