Private Sub EncodeBase64WithLineBreaks (bytes() As Byte) As String
Dim su As StringUtils
Dim s As String = su.EncodeBase64(bytes)
If s.Length <= 76 Then Return s
Dim sb As StringBuilder
sb.Initialize
Dim linelength As Int
For i = 0 To s.Length - 1
If linelength = 76 Then
sb.Append(Chr(13) & Chr(10))
linelength = 0
End If
sb.Append(s.CharAt(i))
linelength = linelength + 1
Next
Return sb.ToString
End Sub