Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

reliable way to validate IBAN/BIC in java [closed]

Tags:

Does anyone know of a reliable way to validate International Bank Account Number (IBAN) and Bank Identifier Code (BIC) in java?

like image 998
tehvan Avatar asked Jun 15 '09 06:06

tehvan


People also ask

How do I validate my IBAN?

Validating the IBAN An IBAN is validated by converting it into an integer and performing a basic mod-97 operation (as described in ISO 7064) on it. If the IBAN is valid, the remainder equals 1. The algorithm of IBAN validation is as follows: Check that the total IBAN length is correct as per the country.

Can I extract BIC from IBAN?

An IBAN contains a bank code but this is not branch specific information which means it is not possible to extract a BIC code from an IBAN.

Why is my IBAN invalid?

If the IBAN you're entering is not accepted in Bankline, double check you've entered the information correctly and try again. If it's still not working you should check with the beneficiary that the information is correct.

How do I find out what my Bic is?

You can usually find your bank's SWIFT/BIC code in your bank account statements.


2 Answers

Apache Commons Validator has IBAN validation (since version 1.4)

Home page: http://commons.apache.org/validator/

Javadoc: https://commons.apache.org/proper/commons-validator/apidocs/org/apache/commons/validator/routines/checkdigit/IBANCheckDigit.html

Maven dependency:

<dependency>   <groupId>commons-validator</groupId>   <artifactId>commons-validator</artifactId>   <version>1.7</version> </dependency> 

Edit: Updated javadoc link.

like image 54
Milanka Avatar answered Sep 27 '22 16:09

Milanka


Apache Commons Validator is good for IBAN validation, but lacks BBAN structure validation (as specified in IBAN registry).

I have just released a library, named jbanking, that might suits your need. It contains routines for both IBAN and BIC validation. You can find it on github (https://github.com/marcwrobel/jbanking).

But note that you cannot have a reliable BIC / IBAN validation without using the IBAN Plus Directory (formely known as the BICplusIBAN Directory) and the Bank directory Plus (formely known as the BIC directory). Both are provided and regularly updated by SWIFT which is the BIC / IBAN registrar. Unfortunately those directories are not available for free.

like image 29
Marc Wrobel Avatar answered Sep 27 '22 16:09

Marc Wrobel