public int importKeysAndEncrypt ( final List < ECKey > keys , KeyParameter aesKey ) { // TODO: Firstly check if the aes key can decrypt any of the existing keys successfully. checkState ( keyCrypter != null , "Not encrypted" ) ; LinkedList < ECKey > encryptedKeys = Lists . newLinkedList ( ) ; for ( ECKey key : keys ) { if ( key . isEncrypted ( ) ) throw new IllegalArgumentException ( "Cannot provide already encrypted keys" ) ; encryptedKeys . add ( key . encrypt ( keyCrypter , aesKey ) ) ; } return importKeys ( encryptedKeys ) ; }
Imports the given unencrypted keys into the basic chain encrypting them along the way with the given key .