public static EnumSet < KeyUsage > getSetOfKeyUsage ( org . bouncycastle . asn1 . x509 . KeyUsage keyUsage ) { if ( keyUsage == null ) { return null ; } Collection < KeyUsage > usages = new ArrayList < KeyUsage > ( ) ; for ( KeyUsage usage : KeyUsage . values ( ) ) { if ( ( ( ( DERBitString ) keyUsage . toASN1Primitive ( ) ) . intValue ( ) & usage . value ( ) ) > 0 ) { usages . add ( usage ) ; } } return EnumSet . copyOf ( usages ) ; }
Convert usages from Bouncy Castle .