private static Path getPrivateKey ( FileSystem fs , String privateKeyPath ) throws IOException { Path keyPath = new Path ( privateKeyPath ) ; FileStatus fileStatus = fs . getFileStatus ( keyPath ) ; Preconditions . checkArgument ( USER_READ_PERMISSION_ONLY . equals ( fileStatus . getPermission ( ) ) , "Private key file should only have read only permission only on user. " + keyPath ) ; return keyPath ; }
Before retrieving private key it makes sure that original private key s permission is read only on the owner . This is a way to ensure to keep private key private .