public byte [ ] calculateAgreement ( byte [ ] publicKey , byte [ ] privateKey ) { if ( publicKey == null || privateKey == null ) { throw new IllegalArgumentException ( "Keys must not be null!" ) ; } if ( publicKey . length != 32 || privateKey . length != 32 ) { throw new IllegalArgumentException ( "Keys must be 32 bytes!" ) ; } return provider . calculateAgreement ( privateKey , publicKey ) ; }
Calculates an ECDH agreement .